Replace CRLF in Notepad++ using regex
By Jessica Wood •
I want to remove CRLFs before a selected word [[orange]] and can use \r\n [CR=\r, LF=\n], but the number of CRLFs available before [orange] is unknown.
Is there any regex available that I can use to remove all CRLFs before [orange] using Notepad++?
1 Answer
Just use * to look for zero or more occurrences of the previous object
(\r\n)*\[orange\]For 1 or more instances use + instead of *
(\r\n)+\[orange\][ and ] are special characters denoting character class so they must be escaped when looking for the literal square brackets