|PHP Developers Network
|Multiple search and replace?
|Page 1 of 1|
|Author:||Mark55 [ Mon Aug 17, 2015 8:00 am ]|
|Post subject:||Multiple search and replace?|
I am beginner with regex, tried to make regex for this problem but coulndt,
I need a single regex to replace multiple words: 111, 222, 333, in text like this with 444, 555, 666 (case insensitive):
To replace with words 444, 555, 666 to have this result:
I managed to replace when every word is in single line, with this in powergrep:
but it doesnt work in above example.
|Author:||requinix [ Mon Aug 17, 2015 4:07 pm ]|
|Post subject:||Re: Multiple search and replace?|
You won't be able to use a single regex to do three different replacements. It has to be three separate ones.
Side note: if the words are as simple as just "111" then you don't need (shouldn't use) regular expressions - simple find-and-replace functions like str_replace() are perfectly fine. And you can give all three replacements at once too.
|Page 1 of 1||All times are UTC - 5 hours|
|Powered by phpBB® Forum Software © phpBB Group