Friday, 23 August 2013

Skip text between quotes in Regex

Skip text between quotes in Regex

I have the following Regex using IgnoreCaseand Multilinein .NET:
^.*?\WtextToFind\W.*?$
Given a multiline input like:
1 Some Random Text textToFind
2 Some more "textToFind" random text
3 Another textToFinddd random text
The current regular expression matches with the lines 1 and 2. However I
need to skip all the lines which textToFindis inside quotes and double
quotes.
Any ideas how to achieve this?
Thanks!

No comments:

Post a Comment