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

Re: Regular Expression Search

by InfiniteSilence (Curate)
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 examining the Monastery: (12)
As of 2014-12-18 12:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (51 votes), past polls