Sample Header Ad - 728x90

regex to replace a word in a block in a file?

0 votes
1 answer
610 views
If I have: words allow bus Is there a regex that can replace allow with something else and keep the other words and the block intact? So it should look like: words not bus or words bus because I will replace the word with something else or take it out. I've tried a regex like this: ((\s|\w|\n)+)allow((\s|\n|\w)+) and replace it with \1\n not \2, but it replaces allow and deletes the second half of the block which I don't want. So is there a regex that can replace a word in a block and keep the block intact?
Asked by W.Smith (23 rep)
Jul 26, 2018, 05:26 PM
Last activity: Jul 26, 2018, 05:39 PM