0

I have the next text:

hola este es un test.
Test de regexp.
Super man
es un héroe de comic.
Test nueva linea

And the result I expected If there are a dot (.), then a carriage return and then a word (A-Za-z), put inside a extra Carriage Returns. Example:

hola este es un test.

Test de regexp.

Super man
es un héroe de comic.

Test nueva linea

How do you do in EditPad Pro replace Panel? I think that I need use Backreferences.

Hernaldo Gonzalez
  • 1,977
  • 1
  • 21
  • 32

2 Answers2

2

Regex:

(\.\r?\n)([A-Za-z])

or

(\.[\r\n]+)([A-Za-z])

Replace with:

\1\n\2

if \1 or \2 won't work then use $1, $2 instead.

Avinash Raj
  • 172,303
  • 28
  • 230
  • 274
0

Backreferences may not be needed:

\.\n

...replaced with...

\.\n\n

...may be good enough. The case where you may want a backreference is if you want to be sure that you don't add an extra newline if there's no following text. In that case:

\.\n([a-zA-Z])

...replaced with...

\.\n\n\1

...should be what you need.

Note, I'm not using EditPad Pro, and different editors use different terminology for backreferences, so it may be \.\n\n$1 instead.

Coleoid
  • 95
  • 6