in reply to Re: Replacing exactly the found instance in REGEX
in thread Replacing exactly the found instance in REGEX

To extend what JavaFan is saying, you can use the s/// operator in place of the test and substitute. In your example there doesn't seem to be any reason to test the string first.

G. Wade