0

I am attempting to learn Regex syntax for use in Notepad++ but I have hit a snag. I need to use the Find/Replace feature to remove a variety of characters from a given block of text and replace them (as a group) with one of these: |

My difficulty is in determining the syntactic construction for specifying the starting and ending characters of the items I want to delete while also allowing any unspecified number of characters between them to be deleted too. The characters can be alphanumeric or nonalphanumeric (e.g. ">").

Here are examples of what I want to replace:

$uadr_ewgh_ksiyer:_

*$addr_abcr:4c_

$plbgtac_tgcvaxd:31_

$id:3_

$scxzatej:u $loihbv:u, $lgftvcu:u 5, 8734 $de 7:22 KL_

$(14836)_

Please note: Those samples also originally contained angled brackets "< >" which will have to be deleted too, but the site seems to think they are being used here as brackets to surround some kind of code. Will Notepad++ accept them as characters to be replaced or do they serve some special function in the syntax that prevents them being specified as a target for removal?

Thank you for your help!!

1
  • 1
    For each example input, could you say what the desired output is? Commented Feb 3, 2017 at 20:09

1 Answer 1

2

Assuming you are replacing everything between the first dollar sign and last underscore, You could find \$.*_ and replace with | or $|_.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.