ikegami's script the the correct way to do it. It doesn't change anything in the file, rather it opens the file handle for output only. If you want to modify the file, that's a totally different procedure and isn't pertinent to the question that you asked about the regex.
In reply to Re^3: regex is not producing desired output
by Khen1950fx
in thread regex is not producing desired output
by manishrathi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |