You can avoid the $& penalty by using parentheses: /(.)/gs and using the $1 variable.
Just to clarify ... you can avoid the $& penalty on all your other regular expressions, but you still pay it on this one (only its name is changed to $1)
In reply to Re: Re: Re: foreach (each character in string..)?
by duff
in thread foreach (each character in string..)?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |