Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^3: Grouped characters inside character class.

by Enlil (Parson)
on Jun 02, 2006 at 02:13 UTC ( #553205=note: print w/replies, xml ) Need Help??

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.

Replies are listed 'Best First'.
Re^4: Grouped characters inside character class.
by blokhead (Monsignor) on Jun 02, 2006 at 02:56 UTC
    That's the same as just being greedy:
    /^Posted by (.*) on /i


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://553205]
[erix]: perlmonks has become read-only ?
[marto]: erix unlikely, we've had posts within the last few minutes ;)
[ambrus]: nysus: make sure you enter at least two lines for the title and then preview, and read warnings the preview form prints
[davies]: There is an option (I have it set) to force preview before submission. Perhaps your option has been set (accidentally?) and you are not expecting it.
[ambrus]: sorry, I mean at least two words for the title and then preview
[ambrus]: davies: that option is the default. and it's not really "force", it just hides the button.
[marto]: yes, not reading the errors displayed has been a cause of this type of report in the past
[nysus]: Ambrus, ah. I think that was the problem. I'll try. Thanks!
[davies]: Ambrus: you've missed it by a couple of weeks, but consider next year's London Perl Workshop.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2017-12-15 11:33 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (431 votes). Check out past polls.