0

If I have a string like "this%25is a%string %" how can I come up with a regex expression that can detect and replace the "%" signs that arent followed by a "25"? So I would wanna leave the %25 alone since its already encoded.

aj soprano
  • 151
  • 1
  • 6

1 Answers1

2

You can use negative lookahead

/%(?!(25))/

This would match any % not followed by 25

more on this

m.marian
  • 146
  • 1
  • 6