Thread: matching against a list of regexp?

matching against a list of regexp?

From
"Gauthier, Dave"
Date:

Hi:

 

I need to be able to select all records with a col value that matches any of a list of regexp.  Sort of like...

 

select a,b,c from foo where d ~ ('^xyz','blah','shrug$');

 

Does anyone know the right syntax for this?

 

Thanks!

Re: matching against a list of regexp?

From
Richard Broersma
Date:
On Thu, Oct 27, 2011 at 9:18 AM, Gauthier, Dave <dave.gauthier@intel.com> wrote:
> I need to be able to select all records with a col value that matches any of
> a list of regexp.  Sort of like...
>
> select a,b,c from foo where d ~ ('^xyz','blah','shrug$');

WHERE d ~ '^xyz|blah|shrug$'


--
Regards,
Richard Broersma Jr.