Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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.


Comment on Re^3: Grouped characters inside character class.
Download Code
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

    blokhead

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://553205]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (19)
As of 2015-07-02 09:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (33 votes), past polls