Friday, 30 August 2013

Match regular expression

Match regular expression

i m new in regular expression, this is my code i want to match create
regular expression which match my string (Presently Working) from
mcName[i].value.i m passing a string "Presently Working in Microsoft" but
its not getting true condition.after condition true i want to fetch next
word which is Microsoft.any one check my regular expression where i going
to mistake.
for (int i = 0; i <= mcName.Count; i++)
{
if ((Regex.IsMatch(mcName[i].Value,
"(^.*\\.[p|P][r][e][s][e][n][t][l][y](
)[w|W][o][r][i][k][n][g])$")))
{
strName = mcName[i + 1].Value.Trim();
}
//return strName
}

No comments:

Post a Comment