Regular Expression in C#
What is the regular expression for finding words starts with given String?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
kaliappan RavikumarPosted Oct 13, 2010, 2:13 AM
I fond Solution for that problem,this is the answer
\bStarting letter\w*\b
Thanks For Reply
kaliappan RavikumarPosted Oct 12, 2010, 5:52 AM
kaliappan RavikumarPosted Oct 12, 2010, 5:30 AM
this my code
string strFind = string.Format("\\b{0}", FindWhat);//Regular expression for finding the index of word starts with given string.
RegexOptions regOPtion = RegexOptions.Compiled;
if (P7FindForm.m_IsSearchUp)
{
regOPtion |= RegexOptions.RightToLeft | RegexOptions.Multiline;
if (!bMatchCase)
regOPtion |= RegexOptions.IgnoreCase;
}
else
{
if (!bMatchCase)
regOPtion |= RegexOptions.IgnoreCase;
}
Regex Regexobj = new Regex(strFind, regOPtion);
Match matchobj = Regexobj.Match(this.Text.ToString(), nStartIndex);
if (matchobj.Success)
FindIndex = matchobj.Index;
Gomathi PalaniswamyPosted Oct 12, 2010, 3:00 AM
You can try like,
[Starting letter]+[a-zA-Z]*