You can do it (in MSSQL) but it won't be RegEx per se. You can have the wildcard
"rules" in the db, and do something like this:
SELECT *
FROM Email_Rules
WHERE ('[EMAIL PROTECTED]' LIKE Rule_To_Check)
In this case, Rule_To_Check would be a field that contains entries like:
Rule_To_Check
-----------------
[EMAIL PROTECTED]
[EMAIL PROTECTED]
But, you are limited to the wildcard characters that LIKE requires:
http://msdn.microsoft.com/library/en-us/tsqlref/ts_la-lz_115x.asp?frame=true
I also don't know how fast this would be.. Though it does work; just tested it.
HTH
-Ryan
-----Original Message-----
From: Howie Hamlin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 24, 2003 10:11 AM
To: CF-Talk
Subject: Re: SQL regex select
Yes, that's what I'm trying to do. This has to do with an idea for email processing
via iMS/FusionMail where certain records are required for different users or entire
domains. For example, I may want to have a template called for every mail going to
coolfusion.com. In my table I would have a rule labeled as [EMAIL PROTECTED] and then
any email to that domain would use that rule.
Thanks,
Howie
----- Original Message -----
From: "Jochem van Dieten" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, September 24, 2003 9:38 AM
Subject: Re: SQL regex select
> Howie Hamlin wrote:
> > I have an application where I want to select rows from a table where
> > the rows match according to a simple regex. For example, say I have
> > the word "tiger" - I would want to select rows with values like:
> >
> > t*
> > *
> > ?????
> > tiger
> > t??er
>
> So let me get this straight. You have the string in your application,
> and you have regex patterns stored in the database, and now you want
> to know which patterns match the supplied string?
>
> BTW, SQL:1999 doesn't do normal regex matchng, so you need to specify
> which dialect your RDBMS uses (and * is not a valid regex pattern).
>
> Jochem
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm?link=i:4:138322
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
ColdFusion MX 6.1, now 2.5 times faster.
http://www.macromedia.com/software/coldfusion/productinfo/upgrade/jump/introducing.html?trackingid=ColdFusion_468x60g_HouseofFusion_carat_082803