Replace regexp capture-group in Notepad ++?

Quick question: I have a regular expression, ^(?:\b[AZ]+\b\s+)+(.*)\d{8} , which gives two capture groups. I would like to replace capture group 1 with a space. Is it possible?

If I replace with: \1 , it replaces TEST TESTER Hello, world. Another word here. 75793250 TEST TESTER Hello, world. Another word here. 75793250 TEST TESTER Hello, world. Another word here. 75793250 β†’ to Hello, world. Another word here Hello, world. Another word here . I want to get this result: TEST TESTER 75793250 . Replace \1 space.

+43
regex notepad ++
Jun 30 '13 at 16:20
source share
2 answers

Try using:

 ^((?:\b[AZ]+\b\s+)+)(?:.*)(\d{8}) 

And replace with:

 \1\2 
+71
Jun 30 '13 at 16:35
source share

Why would you do this.

Do it like this

Regex: ^(\b[AZ]+\b\s+)+(?:.*)(\d{8})

Replace with: \1 \2

+7
Jun 30 '13 at 16:26
source share



All Articles