(1) would be an infinite loop, without a "g" in the regex
Indeed, now corrected. I explicitly remove the /i (and accidentally the /g), because it would give wrong results if the OP really mean 'the' and not 'The' or 'THE'.
simpler code: Will be undef if nothing found.
That is no simpler as you still have to handle the possibility of undef.
In reply to Re^3: count the occurrences of particular word in a file and extract number in ()
by BrowserUk
in thread count the occurrences of particular word in a file and extract number in ()
by allison
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |