Stuart,
if I were you I would also consider the %Regex.Matcher class ReplaceAll method to use.
For example:
set list = "ABC~DEF~GHI~JKL~MNO~[~PQR~]"
set matcher1=##class(%Regex.Matcher).%New("\[",list)
set matcher2=##class(%Regex.Matcher).%New("\]",matcher1.ReplaceAll("Y"))
write matcher2.ReplaceAll("N")
Istvan
- Log in to post comments