i am completely bad with replace option in notepad++ but i use it to edit my txt files and some of the books for my kindle in txt format.
The problem is, in some lines i've got this problem:
example
Emily was a pretty girl , but noone realy liked her.
I would be realy greatfull is someone can help me to replace this space-newline-come to come so the text will look like this
Emily was a pretty girl, but noone realy liked her.
Thank you!
Try to replace this regex:
\s+,
With this:
,
Another option you could do here is use a Negative Lookahead.
Find: \s+(?![^,])
Replace:
Regular expression:
\s+ whitespace (\n, \r, \t, \f, and " ") (1 or more times)
(?! look ahead to see if there is not:
[^,] any character except: ','
) end of look-ahead
Or lookahead to see if there is not word characters.
Find: \s+(?!\w)
Replace:
Regular expression:
\s+ whitespace (\n, \r, \t, \f, and " ") (1 or more times)
(?! look ahead to see if there is not:
\w word characters (a-z, A-Z, 0-9, _)
) end of look-ahead
You could also use a Positive Lookahead here to look ahead to see if there is non-word characters.
Find: \s+(?=\W)
Replace:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With