[V4MD] regex & escape

Martin Kloss martin.kloss at gmx.de
Wed Dec 17 15:37:17 CST 2003


At 14:39 17.12.2003, you wrote:
> > Generate query:
> >
> > ...LIKE '(?i)" & ValentinaEscapeString(myInputString, TRUE) & "'"
> >
> > which results in:
> >
> > LIKE '(?i)m\*ller\'s'
> >
>
>Okay, try FALSE and let me know if REGEX then works fine.

no, it doesn't work. I need to get "*" and "?" to work, but currently it 
doesn't
work either way.

>Assume your string will have () as chars, but not REGEX chars.
>Let use want to find pattern
>
>         m.ller's (data)
>
>Then you need produce
>
>     LIKE '(?i)m.ller\'s \(data\)'

Right, that's what I want, the "(" need to be escaped, but not the "?", I 
thought.
So both ways of escaping (TRUE / FALSE) do NOT work for me at the moment.

TRUE would produce:

    LIKE '(?i)m\?ller\'s \(data\)'

Problem: "?" is escaped, so regex will not be used properly

FALSE would produce:

    LIKE '(?i)m?ller\'s (data)'

Problem: "?" is not escaped, but does not work either.
Also, ")" will be used for regex and that is not desired in this case.

>To do this you need use escape string on user's pattern.

What do you mean?

>BTW, you say about * and ?
>In REGEX is used not * but .

No, I need "zero-or-more", not a quantifier, so the "*" is what I want, not 
the "."
What can I do?

Martin.




More information about the Valentina mailing list