Problem with Find/Replace regex : \n (newline) and \b (boundary) ignored
I have the following text :
Paragraph1 Paragraph2 Paragraph2 Paragraph2 Paragraph2 Paragraph3 Paragraph3 Paragraph4```
I want to merge the lines of each paragraph, in order to get :
Paragraph1 Paragraph2 Paragraph2 Paragraph2 Paragraph2 Paragraph3 Paragraph3 Paragraph4
But I cannot make it work in Editorial's Find/Replace (and I did not forget to choose Regular Expression…)
What do I get wrong ?
I tend to just avoid regex like the plague that it is...
s.replace('\n\n', '<<<!?!>>>').replace('\n', ' ').replace('<<<!?!>>>', '\n\n')
First of all, thank you very much for your answer.
I am a Python newbie… How do I insert this in a workflow ? Through "RunPython script", I suppose (coming after an "Extend Selection" to the whole document ?), but how ?
How come a sequence \b\n\b in Find and a space in Replace does not work, although it works perfectly well in Regex101 ?
Could it be a bug ? I doubt it. I most certainly make a mistake, but where ?
I do not (entirely) share your condemnation of Regexes, but, as you know, nobody is perfect…