在记事本 + + 中替换 regexp 捕获组? ?

快速提问: 我有一个 regexp,^(?:\b[A-Z]+\b\s+)+(.*)\d{8},它提供了两个捕获组。我想用空格替换捕获组1。这可能吗?

如果我用: \1替换,它用 Hello, world. Another word here替换 TEST TESTER Hello, world. Another word here. 75793250-> 。我想要这个结果: TEST TESTER 75793250。用空格替换 \1

80448 次浏览

Do it this way:

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

Replace with: \1 \2

Try using:

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

And replace with:

\1\2