http://www.perlmonks.org?node_id=553205


in reply to Re^2: Grouped characters inside character class.
in thread Grouped characters inside character class.

The only issue with this regex (and the poster's original idea as well) is it will not properly capture the username if it contains ' on '

Noted. So we capture up until the last ' on '.

use strict; use warnings; my $source = 'Posted by getting on my nerves on September 04, 2003'; if ( $source =~ /^Posted by (.*?) on (?!.* on )/i ) { print qq("$1") . "\n"; }

blokhead is right.. and I will go lick my wounds now.