In Notepad++ RegEx, I want to search for all strings starting with a tilde and terminating with \\n, and within each match replace all spaces with non-breaking spaces.
That is, I want to find all instances of \\~.*^
, and within the resulting $0
, replace all [Space]s
with [Non-breaking Space]
.
Is this possible?
With fixed-width pattern lookbehind regex engines (eg, Perl):
s/(~.*?) {2,}/\1 /g
with variable-width pattern lookbehind regex engines:
s/(?<=\~.*) {2,}/ /g
or with Vim:
s/\(\~.*\)@<= \{2,}/ /g
I'm not sure about Notepad++. Hopefully you can work it out based on the above.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.