Regexp rejection

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
chrisjj
Posts: 149
Joined: Sat Jan 21, 2006 10:32 pm

Regexp rejection

Post 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?
Last edited by chrisjj on Thu Apr 03, 2008 1:12 pm, edited 1 time in total.
ben_josephs
Posts: 2459
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Where do TextPad's docs say that its regex recogniser recognises \d? It doesn't. Use [0-9].
chrisjj
Posts: 149
Joined: Sat Jan 21, 2006 10:32 pm

Post 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.
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post 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
ben_josephs
Posts: 2459
Joined: Sun Mar 02, 2003 9:22 pm

Post 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.
chrisjj
Posts: 149
Joined: Sat Jan 21, 2006 10:32 pm

Post by chrisjj »

> TextPad's regular expression recogniser doesn't allow them to refer
> back over a newline.

So it seems. Is there a fix?
ben_josephs
Posts: 2459
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Within TextPad, other than by changing the newlines to something else, doing your stuff, then and changing them back, no.
chrisjj
Posts: 149
Joined: Sat Jan 21, 2006 10:32 pm

Post by chrisjj »

I meant a fix to TextPad. But I guess not.

Would someone please add this to the bug list? Thanks.
chrisjj
Posts: 149
Joined: Sat Jan 21, 2006 10:32 pm

Post by chrisjj »

? Would someone please add this to the bug list?

Please??
Post Reply