Clear questions and runnable code
get the best and fastest answer
Grouped characters inside character class.by the_0ne (Pilgrim)
|on Jun 02, 2006 at 01:10 UTC||Need Help??|
the_0ne has asked for the
wisdom of the Perl Monks concerning the following question:
Monks, I have a regex question for you. I have this string of text...
Using this regex...
I can get "mad max beyond eggdome", which is what I need to pull out. I need to grab everything between "posted by" and the word "on". My problem with that regex is there could be other characters other than \w or \s in between posted by and (space)on(space) and the word "on" could also be a possibility.
So, I tried this...
However, a character class is just that, a character. It's not a group. I can't figure out how to group the characters with a NOT.
I tried this also...
Which I thought would group the (space)on(space) in the character class, but that did not work either. How do you group the characters to say "not group of characters"? I want to say...
Start at the beginning, look for the string "posted by" and then gather all characters that are not (space)on(space), until I find the string (space)on(space). I don't think I'm going in the correct direction.
Thanks for any help, it is greatly appreciated.