Re: [PHP] Apostrophe in preg_match?

2002-08-28 Thread DL Neil
I'm trying to get an apostrophe (and a dash, as well) to be included in a preg_match expression, but I don't know how to escape the characters. The manual discusses which characters need escaping and how to escape characters: http://www.php.net/manual/en/pcre.pattern.syntax.php ?php if

Re: [PHP] Apostrophe in preg_match?

2002-08-28 Thread Andre Dubuc
Thanks DL, I've read that part of the manual. My original syntax was as you suggested [^a-zA-Z-'], but the PostgreSQl query barfed on the apostrophe. The preg_match works, but the db refuses to accept the apostrophe. Reading the postgresql docs, they suggest escaping the character, but since

Re: [PHP] Apostrophe in preg_match?

2002-08-28 Thread DL Neil
Andre, Thanks DL, =a pleasure I've read that part of the manual. My original syntax was as you suggested [^a-zA-Z-'], but the PostgreSQl query barfed on the apostrophe. =these are two quite separate things (1) and (4): 1 accept input ($_POST) 2 validate input 3 prepare input for storage 4