March 23, 2010 at 6:54 am
Hi All
I am having a string that contains a numeric value, to check if the string has numeric value or not can use \d
select dbo.RegexMatch('^(\d{2})','132')
The above result returns 1, but if the same is an alpha numeric then it will return 0
I want to extract all the numeric values from a alphanumeric string, with numeric ranges from 1-100
Ex
test 1234 must return 0
test 12 must return 1
99test must return 1
test 100 must return 1
test must return 0
how do i create a regular expression to get this
Thanks in advance
Cheers
March 23, 2010 at 6:56 am
Have you tried powershell ?
March 23, 2010 at 6:57 am
Use CLR integration.
See this MSDN magazine article: http://msdn.microsoft.com/en-us/magazine/cc163473.aspx
March 23, 2010 at 7:08 am
Thanks guys, i am using CLR, since my string has numerics in any place, so i am just wondering is there any way to use one expression to get this output 🙂
March 23, 2010 at 7:08 am
no Dean , i never used powershell
March 23, 2010 at 7:12 am
There are a number of examples here:
http://www.regular-expressions.info/examples.html
http://regexlib.com/DisplayPatterns.aspx?cattabindex=2&categoryId=3
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply