I'm trying to do a search/replace using regex for mass replacing on Notepad++
I need to add a parameter for each code and name, i tried using (.+) or (.*) for each number, but it didnt work. Each space means that is a different number and not every space has the same width. Example from this:
Abanda CDP 192 129 58 0 0 0 2 3 3 2.998 0.013 33.091627 -85.527029 2582661
To this:
Abanda CDP |code1=192 |code2=129 |code3=58 |code4=0 |code5=0 |code6=0 |code7=2 |code8开发者_运维知识库=3 |code9=3 |code9=2.998 |code10=0.013 |code11=33.091627 |code12=-85.527029 |code13=2582661
Try ([0-9.-]+)
. The reason .+
doesn't work is because .
matches whitespace as well. The reason you can't just use \S+
(non-spaces) is because you only want to match the numbers.
精彩评论