Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Global regexp (Regexp::Exhaustive)

by lodin (Hermit)
on Jun 17, 2008 at 18:09 UTC ( [id://692556]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Global regexp
in thread Global regexp

See Regexp::Exhaustive to get every possible match of a pattern against a string. It supports the use of $& et al (without global penalty).

use Regexp::Exhaustive 'exhaustive'; my @matches = exhaustive( 'asdf' => qr/..??/, qw[ $` $& $' ], ); printf "%s<%s>%s\n", @$_ for @matches; __END__ <a>sdf <as>df a<s>df a<sd>f as<d>f as<df> asd<f>

lodin

Replies are listed 'Best First'.
Re^4: Global regexp (Regexp::Exhaustive)
by Anonymous Monk on Jun 18, 2008 at 04:42 UTC
    Nice package. Thanks.
    Investigation of code in Regexp/Exhaustive.pm showed there's constructions like in ikegami's post: <(?!)/tt> and (?{push @array, ...})

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-25 06:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found