replace - How to insert text before the first line if a certain word exists in the whole text with regex? -
i'd regex.
example:
convert this(where bla can text):
bla bla blaba bla bla blablbalba bala bla cocoa bla bla bla bla bla bla bla bla bla bla
to this:
chocolate unhealty! bla bla blaba bla bla blablbalba bala bla cocoa bla bla bla bla bla bla bla bla bla bla
search
(.*\n.*cocoa.*\n.*)
and replace by
chocolate unhealty!$1
()
stores result can access later $1
. .*
matches char 0 unlimited times. \n
matches newline.
Comments
Post a Comment