I have a line not well formatted in about 1500 files and I plan to correct them in notepad++ with a regex. The thing is that I really suck at regex.
Let me detail my expectations:
Here is the line now:
tags:: tree dog book razor
And here is what I need:
tags:: tree, dog, book, razor
The regex should find the line and add the commas, last word of the line excepted. Some of the pages are well formatted.
I tried many many combinaisons of expressions, some worked in regex101, but nothing worked in notepad++.
You could use this regex:
This matches:
(?:(?<=^tags::)|\G(?<!^)): either(?<=^tags::): positive lookbehind for start-of-string followed bytags::; or\G(?<!^): end of the previous match (but not at the start of the string)(\s*\S+): zero or more of spaces followed by one or more non-space characters, captured in group 1(?=\h): positive lookahead for horizontal whitespaceReplace this with
$1,.Regex demo on regex101