nobre wrote:
> "If the optional ESCAPE clause is present, then the expression following the
> ESCAPE keyword must evaluate to a string consisting of a single character.
> This character may be used in the LIKE pattern to include literal percent or
> underscore characters. The escape character followed by a percent symbol
> (%), underscore (_), or a second instance of the escape character itself
> matches a literal percent symbol, underscore, or a single escape character,
> respectively."
> 
> Choose a escape character and put it before any of the meaningful ones in
> your query to escape it.

Contrary to syntax diagram in documentation, ESCAPE clause does NOT work with
GLOB (or [icu ext] REGEXP) [or, rather, "not implemented" - it would work if
3-arg GLOB function were provided - but it is not].

And it won't solve OP problem anyway.

FWIW, I think this should work:

SELECT FROM t
 WHERE
   foo GLOB replace(replace(replace(?, '[','[[]'),'*','[*]'),'?','[?]')||'*'

(but, of course, it looks clumsy and not future-safe).

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to