#1 2007-10-28 13:03

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

RegEx missing features

Hi Denis,
just a question: what regex engine do you use?

Some engines have advantaged features like the following which i 'miss' in ReNamer.

Maybe you don't know about this and want to improve your engine.


Or you could catch this amiss with your programming,

like
For Search Expression: "IF \u is found in expression THEN exchange this first with [A-Z] AND THEN execute the expression"

or
Replace: "IF \U is found in replace change output to upper case"



The improvement for FIND EXPRESSION is for the laziness of the user only.
The improvement for the REPLACE is very handy and nifty, though there are other ways to do this with ReNamer.
Just some ideas, no push. But would be nice to use full supported regex tongue



------------------------  Some explanations for better understanding:


Shortcuts character classes for Find 'Expression'

There are some shortcuts that can be used in place of the character classes

\l in place of [:lower:]
\u in place of [:upper:]
\L in place of [^[:lower:]]
\U in place of [^[:upper:]]

like
\w in place of [:word:]
\s in place of [:space:]
\d in place of [:digit:]

Some Links:
http://www.boost.org/libs/regex/doc/syntax_perl.html
http://lucersoft.com/HBEPRODOC/Scripts/ … ssions.php


--------------------

Changing case with regular expressions for 'Replace'


Special character          Description

\u                                Converts the next character to uppercase.
\l                                 Converts the next character to lowercase.
\U                                Converts all characters to uppercase until encountering \E.
\L                                Converts all characters to lowercase until encountering \E.
\E                                End \U or \L.

Some links:
http://livedocs.adobe.com/coldfusion/8/ … xp_10.html
http://vim.wikia.com/wiki/Changing_case … xpressions
http://www.javaregex.com/tutorial5.html



Thanks
Stefan


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#2 2007-11-03 22:50

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,374

Re: RegEx missing features

The RegEx engine which I use: TRegExpr (http://www.regexpstudio.com/TRegExpr/TRegExpr.html)

You can find out more from their web site. I am afraid it doesn't have the IF/THEN/ELSE features...

You can simulate this behaviour in the pascal script rule. There are two handy functions:

* function ReplaceRegEx(const Input, Find, Replace: WideString; const CaseSensitive, UseSubstitution: Boolean): WideString;
* function MatchesRegEx(const Input, Find: WideString; const CaseSensitive: Boolean): TStringsArray;

Offline

#3 2007-11-03 23:46

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: RegEx missing features

I have meant IF/THEN/ELSE features.. in YOUR code before you start the RegEx engine
and later before you display the result cool

But i understand there are other possibles, thanks big_smile


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

Board footer

Powered by FluxBB