You are using the /g option on a pattern in boolean context which means that the first time it will match and the second time it will continue searching where the first match ended and will therefore not find another match and will return "false".
In reply to Re^3: Repeated Pattern Matching Fails
by jwkrahn
in thread Repeated Pattern Matching Fails
by perlpal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |