Re: [GENERAL] Regular expression. How to disable ALL meta-character

2005-04-21 Thread Michael Fuhr
On Thu, Apr 21, 2005 at 09:03:43AM -0400, David Gagnon wrote: > > Just want to share the solution I got to solve my problem. I wanted to > be eable to search a string (say X) (non case sensitive) without having > meta-character involved. The X string come directy from the web so any > [%]* may

Re: [GENERAL] Regular expression. How to disable ALL meta-character

2005-04-21 Thread Chris Travers
David Gagnon wrote: Maybe there is a simple way to to this but I want find string X in different column. The search must not be case sensitive. So that searching "aBc" in "abcDef" return true. I don't want META-CHaracter. Or at least I don't want meta-character to cause errors (i.e.: N

Re: [GENERAL] Regular expression. How to disable ALL meta-character

2005-04-21 Thread David Gagnon
Thanks for your help! Just want to share the solution I got to solve my problem. I wanted to be eable to search a string (say X) (non case sensitive) without having meta-character involved. The X string come directy from the web so any [%]* may cause error in regular expression (because they f

Re: [GENERAL] Regular expression. How to disable ALL meta-character in a regular expression

2005-04-20 Thread Michael Fuhr
On Wed, Apr 20, 2005 at 11:28:28AM -0400, David Gagnon wrote: > > I have a web interface with offers a search field. This search field > will look for the string X in 12 different columns. If the string is > found anywhere I return the row. > > The problem is that the user is eable to put spa

Re: [GENERAL] Regular expression. How to disable ALL meta-character

2005-04-20 Thread David Gagnon
Hi Scott, I would generally scrub the input before it go to postgresql. Basically do a simple string_replace type function that replaces anything that ISN'T alphanum with nothing. If I change the original string the user may not get what he expects as result. abc[d] is not the samething tha

Re: [GENERAL] Regular expression. How to disable ALL meta-character

2005-04-20 Thread David Gagnon
Michael Fuhr wrote: On Wed, Apr 20, 2005 at 11:28:28AM -0400, David Gagnon wrote: I have a web interface with offers a search field. This search field will look for the string X in 12 different columns. If the string is found anywhere I return the row. The problem is that the user is eable

[GENERAL] Regular expression. How to disable ALL meta-character in a regular expression

2005-04-20 Thread David Gagnon
Hi all, I have a web interface with offers a search field. This search field will look for the string X in 12 different columns. If the string is found anywhere I return the row. The problem is that the user is eable to put spacial character like : [* This create invalid regular expression an