In NotePad++ I'm trying to replace Jan\d+ with \r\nJan but it's not working the way I thought

丶灬走出姿态 提交于 2019-12-24 22:39:14

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!