Page 1 of 1

Regex newline

Posted: Thu Dec 26, 2002 11:35 am
by Jan Paul
Hi,

Can anybody help me wit a RegEx problem I cannot get fixed.

I what to unwrap several lines.
All the lines beginning with a lowercase character should not be on various lines, but one single line.

ie:
This is
a test
for this RegEx.
This
too.

Must become:
This is a test for this RegEx.
This too.

For now I have found a way to get all lowercase: \n^[[:lower:]].
But what must I place in the replace with field? I have tried \1, but then \1 is filled into the text directly (I have regular expressins tagged).

Could someone help me here?

The above problem fixes only one problem, becuase I have still the problem to resolve about the tokens and upper characters in a textfile that not get corrected this way.

I you have any RegEx way to get text files with a fixed length into a "normal" unwrapped file I would like to know! This would help me a lot.

Thanks, JP

Re: Regex newline

Posted: Thu Dec 26, 2002 10:22 pm
by Andreas
replace
\n\([[:lower:]]\)
by
\1

You have to tell what you want to remember by putting it between \(\)
or, when using POSIX Syntax, between ().

Re: Regex newline

Posted: Fri Dec 27, 2002 6:07 am
by Jan Paul de Frankrijker
Hi Andreas,

Thanks, this helped!

Is there somebody who can help me with a good unwrapping method though?

Thanks, JP

Re: Regex newline

Posted: Fri Dec 27, 2002 7:37 pm
by Roy Beatty
Find...: \.\n<br>
Replace: &\n

These expressions add a blank line at the end of each sentence. Now select all and hit ALT+CTRL+J. Remove blank lines if you need to.

Hope this helps,

Roy

Re: Regex newline

Posted: Fri Dec 27, 2002 7:39 pm
by Roy Beatty
Oops, I meant SHIFT+CTRL+J