in reply to search and replace if pattern found in file

Please also note (and clarify) the disparity between your narrative description of the problem case and your sample IO data... which appears to be more nearly described (but still not accurately) as "surround verbs and/or prepositions with '|'s" or somesuch (frankly, I haven't expended any great effort on defining your problem case... but you should!).

And ask yourself, do you need to do this so many times that a regex, rather than hand editing, is the answer. If so, maybe amend that to 'multiple regexen, applied sequentially.'

Oh yes, also: enclose sample data in code tags, so we don't mis-read that data.

See the instructions at the text-entry form which now exists at the bottom of a page showing your original node.


check Ln42!

  • Comment on Re: search and replace if pattern found in file

Replies are listed 'Best First'.
Re^2: search and replace if pattern found in file
by myfrndjk (Sexton) on Aug 01, 2014 at 19:27 UTC

    Thanks for your feedback.I will follow the same on my future posts