[Solved] Regular expressions in Notepad++. How make pattern that could be use in a few lines


To answer as a general exercise, run

  • replace all cout.*<<.*\K<< with +, many times until it can’t match.
  • replace all cout.*<<.*\Kendl with "\\n", many times
  • replace all cout.*<<.*\K(?<!\))(?=;) with \)
  • replace all cout.*<<with Console.Write\(

from perlre

  • \K (Keep the stuff left of the \K)
  • (?<!..) A zero-width negative lookbehind assertion.
  • (?=..) A zero-width positive lookahead assertion.

1

solved Regular expressions in Notepad++. How make pattern that could be use in a few lines