General questions about using TextPad
Moderators: AmigoJack , bbadmin , helios , Bob Hansen , MudGuard
chrisjj
Posts: 149 Joined: Sat Jan 21, 2006 10:32 pm
Post
by chrisjj » Thu Apr 03, 2008 11:13 am
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: 2461 Joined: Sun Mar 02, 2003 9:22 pm
Post
by ben_josephs » Thu Apr 03, 2008 12:41 pm
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 » Thu Apr 03, 2008 1:16 pm
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 » Thu Apr 03, 2008 1:35 pm
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: 2461 Joined: Sun Mar 02, 2003 9:22 pm
Post
by ben_josephs » Thu Apr 03, 2008 1:52 pm
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 » Thu Apr 03, 2008 2:35 pm
> 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: 2461 Joined: Sun Mar 02, 2003 9:22 pm
Post
by ben_josephs » Thu Apr 03, 2008 2:46 pm
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 » Thu Apr 03, 2008 3:09 pm
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 » Tue Apr 15, 2008 12:05 pm
? Would someone please add this to the bug list?
Please??