On Tue, Dec 13, 2011 at 02:51:15PM +0100, InterRob wrote:
> Thanks guys, i see what you mean.
>
> I do intend to use the PG escaping, in order to avoid that annoying
> warning... Hence, my expression should indeed be:
> SELECT regexp_matches('123-A' , E'(3[A-Z\\-\\(\\) ])');
>
> In the above expression i added the parentheses as I whish to match these
> as well :))
instead of putting that much quoting just do:
SELECT regexp_matches('123-A' , '(3[A-Z() -])');
( and ) don't need to be quoted, and if you'll move - at the beginning
or end (i prefer end) of range, it doesn't need to be quoted either.
Best regards,
depesz
--
The best thing about modern society is how easy it is to avoid contact with it.
http://depesz.com/