Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Keep It Simple, Stupid
 
PerlMonks  

Re: Regular Expression Search

by InfiniteSilence (Deacon)
on Feb 09, 2012 at 18:43 UTC ( #952809=note: print w/ replies, xml ) Need Help??


in reply to Regular Expression Search

~linux>perl -e '$BEGIN{my @found = ()}; $foo = q|A--B|; while($foo=~m/ +\-/g){push @found,@+}; END{print qq|found at $found[0] to $found[$#fo +und]|}'
Prints
found at 2 to 3

Celebrate Intellectual Diversity


Comment on Re: Regular Expression Search
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2014-04-19 21:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (483 votes), past polls