I have the following Regex using IgnoreCase
and Multiline
in .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 textToFind
is inside quotes and double quotes.
Any ideas how to achieve this?
Thanks!
EDIT:
Explanation: My purpose is to find some method calls inside VBScript code. I thought this would be irrelevant for my question, but after reading the comments I realised I should explain this.
So basically I want to skip text that is between quotes or single quotes and all the text that is between a quote and the end of line since that would be a comment in VBScript:
If I'm looking for myFunc
Call myFunc("parameter") // should match
Call anotherFunc("myFunc") //should not match
Call someFunc("parameter") 'Comment myFunc //should not match
If(myFunc("parameter") And someFunc("myFunc")) //should match