Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 961B91337B63 for ; Wed, 8 Dec 2010 09:59:50 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 68239-10 for ; Wed, 8 Dec 2010 13:59:44 +0000 (UTC) X-Greylist: delayed 00:05:49.578244 by SQLgrey-1.7.6 Received: from rs73.luxsci.com (rs73.luxsci.com [64.49.254.135]) by mail.postgresql.org (Postfix) with ESMTP id 9DE6C133798E for ; Wed, 8 Dec 2010 09:59:42 -0400 (AST) Received: from GNANAM (ABTS-TN-Static-186.58.165.122.airtelbroadband.in [122.165.58.186] (may be forged)) (authenticated bits=0) by rs73.luxsci.com (8.13.8/8.13.8) with ESMTP id oB8DrlLj013887; Wed, 8 Dec 2010 07:53:49 -0600 Reply-To: From: "Gnanakumar" To: Subject: Regular Expression Match Operator escape character Date: Wed, 8 Dec 2010 19:21:44 +0530 Organization: Zoniac Software Private Limited Message-ID: <006601cb96df$0fd82cd0$2f888670$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcuW3wwSwMJVFTn8S+SkJv9U2Kubow== Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.572 tagged_above=-5 required=5 tests=BAYES_50=0.8, MAY_BE_FORGED=0.772 X-Spam-Level: * X-Archive-Number: 201012/45 X-Sequence-Number: 34881 Hi, We're running PostgreSQL v8.2.3 on RHEL5. In some places in our application, we use Regular Expression Match Operator (~* => Matches regular expression, case insensitive) inside WHERE criteria. Example: SELECT ... FROM ... WHERE (SKILLS ~* '(^|\\^|\\||[^0-9|^a-z|^A-Z]|$)C#(^|\\^|\\||[^0-9|^a-z|^A-Z]|$)' OR SKILLS ~* '(^|\\^|\\||[^0-9|^a-z|^A-Z]|$).NET(^|\\^|\\||[^0-9|^a-z|^A-Z]|$)') In this case, we're trying to search/match for either "C#" OR ".NET" in SKILLS column. My question here is, do I need to escape the characters "#" and "." here? Regards, Gnanam