Regular Expression in C#
What is the regular expression for finding words starts with given String?
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Gomathi PalaniswamyRank #714 · 3.3K reputationPosted Oct 11, 2010, 11:00 PM EDT
You can try like,
[Starting letter]+[a-zA-Z]*
kaliappan Ravikumar29 reputationPosted Oct 12, 2010, 1:30 AM EDT
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;
kaliappan Ravikumar29 reputationPosted Oct 12, 2010, 1:52 AM EDT
kaliappan Ravikumar29 reputationPosted Oct 12, 2010, 10:13 PM EDT
I fond Solution for that problem,this is the answer
\bStarting letter\w*\b
Thanks For Reply