0

I'm not really good with Regular expression, but I'm trying to run a "Replace All" on a conditional regular expression search.

In my regex search (results(.*)continue), I'm trying to find the word "continue" on lines that also have the word "results". Is there any to replace "continue" of just these search results other than manually changing them?

example:

Results(.*)Continue
This sentence contains the word continue.
Results 2(.*)Continue

to

Results(.*)End
This sentence contains the word continue.
Results 2(.*)End

Thank you.

1 Answer 1

0

Not sure if it is the most efficient, but try the following:

  • Find what: (?<=Results)(.+)Continue
  • Replace with: \1End
  • Search mode: Regular expression
3
  • This is great! Sorry to ask for additional help, but is there any way to refine the original search? Would it be possible to search for lines that contain: results, continue; and excludes: testing
    – SSxsilver
    Commented Jul 9, 2023 at 6:00
  • If this question has been successfully answered, mark it as answered. See What should I do when someone answers my question?. You will need to ask another question and link it to this one as you are including new requirements Commented Jul 9, 2023 at 9:10
  • Oh okay, I will try that. Thank you again, Reddy.
    – SSxsilver
    Commented Jul 10, 2023 at 23:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .