REGEX \ search

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Jul 20 17:26:55 CDT 2005


On 7/20/05 5:14 PM, "jda" <jda at his.com> wrote:

>>> My application (a general consumer application) takes care of
>>>  the details for them...
>> 
>> Then its your headache. :-)
>> 
> 
> My headache is your headache. :-)
> 
> Fine, I can do that. But I think it is wrong to require *4*
> backslashes to escape \
> 
> And if it does,
> 
> Valentina.escape('\', true)
> 
> should return
> 
> '\\\\'
> 
> !!!!

No, because Valentina.Escape() care about people who know LIKE and REGEX.

User can enter such regex:

        \Abline\Z

Now back slash play role of SPECIAL CHARACTER.
We do not search for it.

So  Escape("\Abline\Z")
        
    returns "\\Abline\\Z"

SQL Parser eat one slash as store string as \Abline\Z
            
And REGEX engine get correct string \Abline\Z


-------------
Compare this to next string.

User want find li\ne
So he type


        \Ali\\ne\Z

Valentina Escape convert this into

        \\Ali\\\\ne\\Z

SQL parser back to

        \Ali\\ne\Z


---------------------
Jon, your problem is that you try to use REGEX in wrong way.
Since you say users do not REGEX you need self correct their entry.



-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina-beta mailing list