Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 having an uproarious good time at the Monastery: (7)
As of 2015-07-03 16:23 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 (54 votes), past polls