Subject Re: [firebird-support] Re: Relgular Expression
Author Jonathan Neve
Svein Erling a écrit :

>--- In firebird-support@yahoogroups.com, "Gustavo Moda (Yahoo)" wrote:
>
>
>>Hello All,
>>
>>FIREBIRD 1.5 work with Regular Expression?
>>If Yes, Does anyone know of links/refrences I use R.E. ?
>>If No, Exists UDF?
>>
>>
>
>What is a regular expression? Show us an example of what you want.
>
>Set
>
Regular expressions come from the world of unix, awk, grep and perl. An
example would be the following expression :

s/P(.*)Test(.*)p/$1$2/

which finds the first string starting with a 'P', followed by 0 or more
characters, followed by the string 'Test', more characters, and the
string 'p', and replaces this string by the two strings that are in
brackets. In other words, it removes the 'P', 'Test', and 'p' characters.

This is a useless example, but it shows the sort of thing you can do
with regular expressions. A regular expression is basically a concise
and simple way to match even the most complex string patterns, and
perform just about any string manipulation you can think of, in about 1
line of code...!

Personnally, I would love to have a udf that handles them. There's
nothing that comes close to Regular expressions for power and
simplicity, even though they do take a bit of getting used to!

Jonathan Neve.