I wonder if you'd care to suggest how we could improve the documentation for s/// to make it more obvious how to solve your problem. Currently the documentation says this:
Searches a string for a pattern, and if found, replaces that pattern with the replacement text and returns the number of substitutions made. Otherwise it returns false (specifically, the empty string).
Update: s///, not chdir...
In reply to Re: Replacement regular expression which return the number of replacement it does
by Corion
in thread Replacement regular expression which return the number of replacement it does
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |