Search code examples
regexvb.netnotepad++text-editorfind-replace

find word in not commented code vb.net using regex in notepad++


how can I use search for a word but not in commented text, for example i need to find lines contains datatable but not proceeded by single quote

property xxx as datatable
proptery xxx as object 'datatable adasdasdas
'dim x as datatable
dim x as datatable = new xxxx

the search result should highlight these lines, as they contains word datatable and its not proceeded by single quote property xxx as datatable dim x as datatable = new xxxx

thanks


Solution

  • ^([^']*datatable.*?)$
    

    Have a look at the DEMO