Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

regular expression format supported by that CLR Expand / Collapse
Author
Message
Posted Tuesday, January 29, 2013 5:43 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 21, 2013 11:25 PM
Points: 2, Visits: 15
Hi,

I am new for CLR..

I want to achieve following criteria.
The format can be formatted as It can begin with V, E, or a number.
• If it begins with V, then it has 2 numbers, a decimal, then up to two numbers
Examples: V10.12 and V12
• If it begins when E, then it has 3 numbers, the decimal place, then up to two numbers
Examples: E000.0 and E002
• If it begins with a number, then it is up to 3 numbers, a decimal, then up to two numbers
Examples: 730.12 and 730

Will you please help me in creating regular expression in sql server, need to create CLR for that will you please create a regular expression CLR and I want one regular expression format supported by that CLR with above conditions

Regards,
Tony
Post #1412963
Posted Tuesday, January 29, 2013 9:26 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 2:49 PM
Points: 13,069, Visits: 11,908
What have you tried so far?

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1413138
Posted Tuesday, January 29, 2013 9:31 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 7:40 PM
Points: 12,880, Visits: 31,802
this CLR code is really nice, and something i have on my dev server:
http://www.simple-talk.com/sql/t-sql-programming/clr-assembly-regex-functions-for-sql-server-by-example/


for the expression itself, it looks very close to the format for an ip address;
take a look at the example here for IP Address:
http://www.regular-expressions.info/examples.html

but i think it will be something like \bV\d{1,3}\.\d{1,3}\b to matc a 2 part verison name like V3.40


Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1413142
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse