in reply to Re^2: Inherited a perl script...need help (s///)
in thread Inherited a perl script...need help

As I said in the CB, if you only want to replace exact matches (eg: 0300), make sure there isn't a number before or after it:

s/(?!<\d)0300(?!=\d)/9999/g

Replies are listed 'Best First'.
Re^4: Inherited a perl script...need help (almost)
by tye (Sage) on Nov 11, 2015 at 21:25 UTC
    s/(?!<\d)0300(?!=\d)/9999/g

    should be

    s/(?<![0-9])0300(?![0-9])/9999/g

    My main point is that both look-behind and look-ahead were using the wrong syntax. My replacement of \d with [0-9] is likely not required.

    - tye