[V4MD] regex & escape

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Dec 17 19:52:26 CST 2003


on 12/17/03 7:43 PM, Martin Kloss at martin.kloss at gmx.de wrote:

> At 17:52 17.12.2003, you wrote:
>> Let's forget about escaping.
>> Please show me small example. Records you have
> 
> Do you still have my DemoDB?

no

> You can try this with the demo db I sent you:
> 
> SELECT * FROM Data WHERE title LIKE '(?i)petrova'
> -- returns 1 record
> 
> SELECT * FROM Data WHERE title LIKE '(?i)petr?va'
> -- returns 0 records
> 
> SELECT * FROM Data WHERE title LIKE '(?i)petr*va'
> -- returns 0 records

Again, Martin.

It seems you not correctly understand how * works in REGEX.

You think that 'petr*va' will return you

            petrova
            petrava
            petrva
            petrabcdefgva

Yes?

I think you need then

            'petr.*va'


* is ZERO or MANY repeating of PREV character to *



> Which is funny, because in other cases it works:
> 
> SELECT * FROM Data WHERE title LIKE '(?i)p?trova'
> -- returns 1 record
> 
> SELECT * FROM Data WHERE title LIKE '(?i)p*trova'
> -- returns 1 record
> 
> This doesn't make any sense to me...

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list