Page 1 of 1
multiline regex
Posted: Wed Apr 28, 2010 7:19 am
by leegold
Just realized there's no multiline regex in Textpad. That should be fixed ASAP IMHO.
Posted: Thu Jun 03, 2010 7:58 pm
by polebridge
Do you mean a regex that will match across a newline? try \n
abc
def
abc
ghi
so "abc\ndef" will match line 1-2, but not 3-4
and "abc\n.*\nab" will match line 1, 2, and part of 3
Or do i misunderstand your issue?
Posted: Thu Jun 03, 2010 9:59 pm
by ben_josephs
If you need to match a fixed number of newlines you can use \n.
But TextPad's regex engine doesn't allow a \n to be quantified with a * or +, or to be contained in a parenthesised expression. So you can't match an arbitrary number of newlines.
Posted: Fri Jun 04, 2010 6:23 am
by MudGuard
ben_josephs wrote:If you need to match a fixed number of newlines you can use \n.
But TextPad's regex engine doesn't allow a \n to be quantified with a * or +, or to be contained in a parenthesised expression. So you can't match an arbitrary number of newlines.
And backreferences do not work across lines as well.
Posted: Fri Jun 04, 2010 11:49 am
by polebridge
Hi ben and Mud,
"parenthesized" and "backreferences"
I ran into those issues this morning, came here to edit my post, but found you guys were all over it. Thanks!