Carriage Return in Replace - RegEx

Every time I encounter some italics in the text I want to start a new paragraph. The italics have been marked by …

When I have done such things in, for example BBEdit, this would work.

Search: (.+: )

Replace: \r\1

And a carriage return would be placed before every instance of italics. So blahblah some italics more stuff would get replaced with

blahblah
some italics more stuff

However, when I tried this with XoJo I just end up with

blahblah\rsome italics more stuff

So it is as if \r means nothing special in the Replace area.

When I look at the Documentation, I do not see anything about \r being recognized in the Replace: area. If so, this seems like a big deficiency.

  1. Is this true or am I making a stupid mistake?

  2. Is there a work-around?

Mac OS 10.11 Xojo 2015 Release3

There is a spurious colon : in the Search in my first comment. Ignore that.

Should have been

Search: (.+)

The replacement is not a regex. So EndOfLine.Macintosh is correct as replacement.

replaceall would suffice for this

simply replace all with endofline +

I just end up with

blahblahEndOfLine.Macintoshsome italics more stuff

Don’t use EndOfLine as literal. Instead of

“\r\1”

you need

EndOfLine.Macintosh + “\1”

Mind the quotes!

Beatrix means, instead of:

rx.ReplacementPattern = "\\r\\1"

use

rx.ReplacementPattern = EndOfLine.Macintosh + "\\1"

However, as Norman pointed out, ReplaceAll is all you need.