the_0ne has asked for the wisdom of the Perl Monks concerning the following question:
Using this regex...Posted by mad max beyond eggdome on September 04, 2003
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.source =~ /^posted by((\w|\s)+)\son\s/i;
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.source =~ /^posted by([^\son\s]+)\son\s/i;
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...source =~ /^posted by([^(\son\s)]+)\son\s/i;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Grouped characters inside character class.
by Enlil (Parson) on Jun 02, 2006 at 01:39 UTC | |
by m.att (Pilgrim) on Jun 02, 2006 at 01:49 UTC | |
by Enlil (Parson) on Jun 02, 2006 at 02:13 UTC | |
by blokhead (Monsignor) on Jun 02, 2006 at 02:56 UTC | |
by the_0ne (Pilgrim) on Jun 02, 2006 at 01:45 UTC | |
|
Re: Grouped characters inside character class.
by Zaxo (Archbishop) on Jun 02, 2006 at 01:47 UTC | |
by the_0ne (Pilgrim) on Jun 02, 2006 at 03:54 UTC |