我有这样的数据:
~10~682423~15~Test Data~10~68276127~15~More Data~10~6813~15~Also Data~
I'm trying to use Notepad++ to find and replace the values within tag 10 (682423, 68276127, 6813) with zeroes. I thought the syntax below would work, but it selects the first occurrence of the text I want and the rest of the line, instead of just the text I want (~10~682423~
, for example). I also tried dozens of variations from searching online, but they also either did the same thing or wouldn't return any results.
~10~.*~
You can use:
(?<=~10~)\d+(?=~)
and replace with0
. This uses lookarounds to check that~10~
precedes the\d+
group and the(?=~)
ensures a~
follows the digit group.