It looks to match the boundaries, and the beginning and end. They are matched because you are searching for 0 or more x's.# Not greedy pos() = 0; $string = q(xxxx); $count = ($string =~ s/[^x]*?/#/g); print qq($string $count), $/; __OUTPUT__ #x#x#x#x# 5
- Tom
In reply to Re: Regex (counting) confusion :(
by tcf22
in thread Regex (counting) confusion :(
by snax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |