I have the following code that works, but would like to edit it up using LINQ
to find if any of the Regex
search strings are in the target.
foreach (Paragraph comment in
wordDoc.MainDocumentPart.Document.Body.Descendants<Paragraph>().Where<Paragraph>(comment => comment.InnerText.Contains("cmt")))
{
//print values
}
More precisely I have to select through LINQ
if the string start with letters or start with symbols -
or •
This Regex
is correct for my case ?
string pattern = @"^[a-zA-Z-]+$";
Regex rg = new Regex(pattern);
Any suggestion please?
Thanks in advance for any help