hi i want to replace all “e” in a string with “-” which are NOT following a backslash
so “hello” should be -> “h-llo” but “h\ello” should be “hello” any ideas if this is possible with a single regex?
hi i want to replace all e in a string with – which are
Share
There is no way but to use the
eflag if you need to combine both regexes since the replacement is different.(Usage: http://www.ideone.com/S2uiS)
There is no need to use regex though. The
strtrfunction is capable of performing this kind of replacement.(Usage: http://www.ideone.com/yg93g)