Re: [Sqlrelay-discussion] case-insensitive router/filter settings
Brought to you by:
mused
|
From: David M. <dav...@fi...> - 2008-02-05 04:58:34
|
The only gotcha that I can think of is that (?i) works with pcre, but with posix regular expressions there's no way to do it within the expression so it won't be portable. A more portable, though imperfect solution would be something like: ^\s*(select|SELECT|Select)\s+.* imperfect though because it doesn't cover all possible permutations, just ones that whoever's writing the queries are likely to use. I'd personally use the (?i) Dave dav...@fi... On Mon, 2008-02-04 at 11:15 -0500, John Klassa wrote: > I noticed that the pattern for a route/filter is case-sensitive... > That is, if you specify: > > <query pattern="^\s*select\s+.*"/> > > then only something like "select x from y" will get through; doing > "SELECT x from y" will *not*. > > Since the system uses PCRE, I tried the perl approach and did: > > <query pattern="(?i)^\s*select\s+.*"/> > > This seems to fix it, so that "select" and "SELECT" both work nicely. > Just curious as to whether this is the intended way to do this? Any > unforeseen gotchas? > > Thanks, > JK > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > > __________________________________________________ > D O T E A S Y - "Join the web hosting revolution!" > http://www.doteasy.com __________________________________________________ D O T E A S Y - "Join the web hosting revolution!" http://www.doteasy.com |