问题
10 Sts - $5,763Jan17 11 Lon -2 ft-1 Janet HallFeb2 9 Lon -10gd-4 F-nw7000lc
Using Notepad++ in the above phrase I wanted to start a new line with the dates Jan17 and Feb2 but when I try Jan\d+ to \r\nJan I get Jan 11 Lon -2 ft-1 Janet Hall without the 17 part of the date.
I can split the line again with Feb\d+ to \r\nFeb but again the 2 part of the date is missing in the newly created line.
回答1:
You need to use a replacement group.
Try Find what: Jan(\d+)
Replace: \r\nJan\1
Using (\d+) will capture the number into a replacement group. Using \1 will insert the captured characters in the first replacement group.
来源:https://stackoverflow.com/questions/29284546/in-notepad-im-trying-to-replace-jan-d-with-r-njan-but-its-not-working-the