Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: position after global matches?

by duff (Parson)
on May 29, 2007 at 18:56 UTC ( [id://618031]=note: print w/replies, xml ) Need Help??


in reply to position after global matches?

Since I didn't see anyone mention this (now watch someone submits a node that does while I'm busy typing), if you don't really need a regular expression, you might be better off just using index

#!/usr/bin/perl $_ = 'TATATATATATA'; $str = "TATA"; $p = -1; while (1) { $p = index($_,$str,$p+1); last if $p < 0; print "Found $str at position $p\n"; }

Log In?
Username:
Password:

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

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

    No recent polls found