I have a text file that has incorrectly placed line breaks. The position where the line break should be placed goes like this …xxxXxxx… (every x is a character [a-z] with the capital X being a capital character [a-z]. I want to place the CRLF in front of the capital letter. How do I do it? I can find all these sequences by Find what: [a-z][A-Z][a-z] (match case 1) but I don’t know what to type in the Replace with field to keep the original text.
>Solution :
- Ctrl+H
- Find what:
(?<=[a-z])(?=[A-Z]) - Replace with:
\r\n - CHECK Match case
- CHECK Wrap around
- CHECK Regular expression
- Replace all
Explanation:
(?<=[a-z]) # positive lookbehind, make sure we have a lowercase letter before
(?=[A-Z]) # positive lookahead, make sure we have an uppercase letter after
Replacement:
\r\n # CRLF
Screenshot (before):
Screenshot (after):

