The /g flag on regex means global search, so the regex will be applied several times on the string, starting each time from the end of the previous match. In list context (eg, when you affect the result to an array), this returns the list of captures (or, if none, the list of full matches). In my example above, I capture one digit, then try to match another character. If perl does manage to match that additional character (ie, it's not the end of the string), it will start looking after that position on the next attempt.perl -lE "print '041424344454647484940414' =~ /(\d).?/g" 012345678901
More info on that in perlretut and the description of the m// operator in perlop.
In reply to Re: Minimizing the amount of place holders on long identical regex
by Eily
in thread Minimizing the amount of place holders on long identical regex
by thanos1983
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |