Home > Back-end >  Visual Studio Community: Delete lines prefixed by a line feed
Visual Studio Community: Delete lines prefixed by a line feed

Time:09-11

In this code enter image description here I'd like to delete the line 2207 and 2208.

I tried several replace actions in the "Search & Replace" tools but none works

  • \r\n WriteDumbowLog("MethodName:" & methodName)"
  • "\n\r WriteDumbowLog("MethodName:" & methodName)"
  • ".$ WriteDumbowLog("MethodName:" & methodName)"
  • "\n WriteDumbowLog("MethodName:" & methodName)"

CodePudding user response:

The correct regular expression is:

((\r\n)|\n|\r) WriteDumbowLog\("MethodName\:" & methodName\)

I used this extension https://marketplace.visualstudio.com/items?itemName=PeterMacej.MultilineSearchandReplace which doesn't work (oddly) but provide you the correct regex to replace.

  • Related