Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
Development
»
Regular Expression or RegEx in SQL Server...
Regular Expression or RegEx in SQL Server 2005
Rate Topic
Display Mode
Topic Options
Author
Message
ramoha
ramoha
Posted Wednesday, February 04, 2009 4:00 PM
SSC Veteran
Group: General Forum Members
Last Login: Yesterday @ 1:48 PM
Points: 214,
Visits: 172
Hi,
Can anyone give me an idea of how we configure and use "Regular Expressions"?
I want to use it for example:
select col1, col2, col3,EmailAddress
from Person.Contact
where dbo.RegExMatch('[a-zA-Z0-9_\-]+@([a-zA-Z0-9_\-]+\.)+(com|org|edu|nz|au)', EmailAddress) = 1
Questions:
1. Do we need to write any c# code and compile it as dll
2. Create a CLR proc?
Any inputs highly appreciated!!!
Thanks in advance,
Razi
http://www.questivity.com
Razi, M.
http://questivity.com/it-training.html
Post #650459
Jack Corbett
Jack Corbett
Posted Thursday, February 05, 2009 6:24 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 10:45 AM
Points: 10,613,
Visits: 11,957
1. Yes, to the best of my knowledge you would need to develop a CLR function in C# or VB.
2. Yes, although you would want a function not a procedure.
Jack Corbett
Applications Developer
Don't let the good be the enemy of the best. --
Paul Fleming
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #650774
ramoha
ramoha
Posted Thursday, February 05, 2009 10:02 AM
SSC Veteran
Group: General Forum Members
Last Login: Yesterday @ 1:48 PM
Points: 214,
Visits: 172
Hi Jack,
Thanks for the reply. Do you have any sample code or step by step procedures for this?
Regards,
Razi
http://www.questivity.com
Razi, M.
http://questivity.com/it-training.html
Post #651045
Jacob Luebbers
Jacob Luebbers
Posted Sunday, February 22, 2009 5:02 PM
Old Hand
Group: General Forum Members
Last Login: Wednesday, June 05, 2013 5:42 PM
Points: 318,
Visits: 1,173
Razi,
There are a lot of examples on here - just search for "regex" and you'll find what you need. Matt Miller especially has provided samples:
http://www.sqlservercentral.com/Forums/Topic490684-149-1.aspx?Highlight=regex
Regards,
Jacob
Post #662307
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.