Replacing text using regex expression in Notepad++

babybear

I want to find words starting with stop. and extract the string that follows the word. Each string should be in a new line.

Also the results file should not have any duplicates.

Example file:

example regex stop.variant1
stop stop.variant_2 examplestop
stopstopvariant
stop.variant_@_3

Result:

variant1
variant_2
variant_@_3
Toto
  • Ctrl+H
  • Find what: .*?(\bstop\.variant\S*)
  • Replace with: $1\n
  • CHECK Match case
  • CHECK Wrap around
  • CHECK Regular expression
  • CHECK . matches newline*
  • Replace all

Explanation:

.*?                 # 0 or more any character
(                   # group 1
    \b              # word boundary
    stop\.variant   # literally
    \S*             # 0 or more non spaces
)                   # end group

Screen capture:

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

RegEx for replacing a text based on another text in Notepad++

Using regex for repeating text in Notepad++

regex expression in Notepad++

Evaluate an expression while replacing in Notepad++

notepad++ remove text between two string using regular expression

Remove text between the tags using regular expression in notepad

Regular expression to replace text between XML tags using Notepad++

Regex not replacing text in JS

regular expression for replacing string in one column of text using perl

Performance problem when replacing an innerHTML text using regular expression

Replacing multiple entires in a text file using a regular expression

Notepad++ Regex command for deleting and replacing

How to replace a text using the found expression with regex?

How to remove a character from text using regex in notepad ++?

Regex Search and Replace specific text on a csv using Notepad++

Replacing all ID to Class with certain name using regEx in Sublime Text

Replacing some text in multiple lines - Notepad++

Using regex in notepad++

Replacing text in a string with recursion and regex

replacement of text using Notepad ++

Replacing text using a filter

Regular expression for replacing using sed

Finding and replacing variable digits with regular expression in notepad++

Regex Expression working in Notepad++ but not Java

Which RegEx expression to find in notepad++?

Notepad ++ regex. Finding and replacing with wildcard, but without allowing any spaces?

Notepad++ RegEx Help - Replacing from this point to another

How to extract text between certain patterns using regular expression (RegEx)?

isolating words using regex expression to text with separators specific