in reply to Re: Map file-glob-style patterns to SQL "LIKE" expressions, with escaping
in thread Map file-glob-style patterns to SQL "LIKE" expressions, with escaping
a file-glob sees a backslash escape before the "?" and "*" (to match a literal question mark and asterisk), and treats "_" and "%" as normal (literal) characters.what\?_not\*.%
For conversion to an sql "like" pattern, the "\" must be removed from in front of "?" and "*" (because these characters don't need to be escaped now) and must be added in front of each "_" and "%" (to keep them literal, as they were in the file-glob).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Map file-glob-style patterns to SQL "LIKE" expressions, with escaping
by merlyn (Sage) on Apr 01, 2005 at 03:28 UTC |