Page 1 of 1

RegExpression does work in v4.4 but not in v4.5

Posted: Tue Nov 05, 2002 5:54 pm
by Peter
I want to search and replace german version date like
14.05.2002 into this 2002-05-14.
I'm using this regex:
([0-9]+)[.]([0-9]+)[.]([0-9]+)

I am replacing with
\3-\2-\1

This is working very fine with Textpad 4.4.0

But Textpad v4.4.2 and later (v4.5) tells me it cannot find the regexpression!

What can I do?

Re: RegExpression does work in v4.4 but not in v4.5

Posted: Tue Nov 05, 2002 6:33 pm
by Scott
Try \([0-9]+\)[.]\([0-9]+\)[.]\([0-9]+\)

Re: RegExpression does work in v4.4 but not in v4.5

Posted: Tue Nov 05, 2002 6:35 pm
by Stephan
For grouping you'll need to put backslashes before the parens.
Therefore this should do:

\([0-9]+\)\.\([0-9]+\)\.\([0-9]+\)

Note that I also replaced "[.]" by "\.". This is partly just my personal tase, but I think it should be a bit faster, too. (Not that it counts much in this example - but then how knows how many dates you're going to replace. :)

Hope that helped.

Stephan

Re: RegExpression does work in v4.4 but not in v4.5

Posted: Tue Nov 05, 2002 6:41 pm
by Andreas
Looks like the "Use Posix Regular expression syntax" is set differently on your 4.5 Textpad
I think after installation it is not checked.

It is the last check box on the "editor" page of the Configure/Preferences dialog

Re: RegExpression does work in v4.4 but not in v4.5

Posted: Tue Nov 05, 2002 8:23 pm
by Peter
Just waited one hour and voila, two solutions are working. Thats great.

With the "Use Posix syntax " checked it looks like the most simple solution.
Das wars. Häkchen hin und geht.

Thankx to all for your very fast and helpful answers.
Hallo und Grüsse an ".dip.t-dialin.net" und "dip0.t-ipconnect.de".

Textpad ist prima. Das Forum ist perfekt.
Nicht mal eine Stunde für die passende Antwort.
Danke.

Re: RegExpression does work in v4.4 but not in v4.5

Posted: Tue Nov 05, 2002 10:22 pm
by Stephan
Da nicht für! :-)