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"; }
|
|---|