Page 1 of 1
Regexp rejection
Posted: Thu Apr 03, 2008 11:13 am
by chrisjj
TextPad 5.2.0 Find what:
\([[:digit:]]*\)\n\1
(with '[X] Regular expression') says
Invalid regular expression
This behaviour fails to accord with the docs.
Is there a fix?
Posted: Thu Apr 03, 2008 12:41 pm
by ben_josephs
Where do TextPad's docs say that its regex recogniser recognises \d? It doesn't. Use [0-9].
Posted: Thu Apr 03, 2008 1:16 pm
by chrisjj
ben_josephs wrote:Where do TextPad's docs say that its regex recogniser recognises \d?
Whoops, sorry, my error - report now corrected. And fault still present.
Posted: Thu Apr 03, 2008 1:35 pm
by ak47wong
The other fault is the \1 in the search expression. That can only be used in a replacement expression, to represent the text matched between \( and \).
Andrew
Posted: Thu Apr 03, 2008 1:52 pm
by ben_josephs
Back-references such as \1 can be used in regular expressions. Unfortunately, TextPad's regular expression recogniser doesn't allow them to refer back over a newline. That is, you can't have a newline between a captured subexpression and a reference back to it.
Posted: Thu Apr 03, 2008 2:35 pm
by chrisjj
> TextPad's regular expression recogniser doesn't allow them to refer
> back over a newline.
So it seems. Is there a fix?
Posted: Thu Apr 03, 2008 2:46 pm
by ben_josephs
Within TextPad, other than by changing the newlines to something else, doing your stuff, then and changing them back, no.
Posted: Thu Apr 03, 2008 3:09 pm
by chrisjj
I meant a fix to TextPad. But I guess not.
Would someone please add this to the bug list? Thanks.
Posted: Tue Apr 15, 2008 12:05 pm
by chrisjj
? Would someone please add this to the bug list?
Please??