Text.RegularExpressions.Regex class in c#, in this class I am trying to find string that contains "years" word within
string s11 ="java developer in new york 2years exp"
before i am using
Regex = new Regex("(\d+)(years?)");
here i am getttig inter value in the given string of s11 like
Match match = regex.Match(ss);
if(match.Success)
{
string s = match.Groups[1];
string s1 = match.Groups[2];
}
but this one only works with integer, if suppose I change my string, like:
string s11="java developer in new york 0.10years exp"
it stops working.
I want work with both integer or decimal like
string s11="java developer in new york 2years exp"
string s11="java developer in new york 0.10years exp"
can any body give the correct solution for this problem; that is to look for both integer and decimal value.
Thanks pradeep