Say I have a text:
Multiple words
In yellow and in blue
How can I make it to this?
multiple-words as "Multiple words"
in-yellow-and-in-blue as "In yellow and in blue"
So far my best try is this:
(.*)
-\1- as "\1"
To have it in the form of -Multiple words- as "Multiple words"
. The -
is to mark the boundary easier. But I can't tell it to only replace the spaces in between the boundaries.
You can do that in several steps:
^.*$
and replace with $& as "$&"
: it just wraps all lines with quotes.(?:\G|^\S*)\K\h+(?=.* as ".*"$)
and replace with -
: it replaces all horizontal whitespaces (\h
) from the start of the line till a as "..."
pattern.(?:\G-|^)[^-]+(?=\S* as ".*"$)
and replace with \L$&
: it will turn to lowercase all chunks of non-hyphen chars from the start of string till as "..."
pattern.Note \L
, \U
and other case changing operators do not work with non-ASCII letters in Notepad++.