how to use Regular Expression to Find in Files a line with word A but not with word B?


  • I want to find all lines in my project that have "dim" but not " as ".

    I cannot figure this out.
    Cannot get answer from online MSDN or Stackoverflow.

    I'm using Visual Studio 2017 Pro, VB.

    software developer

    Friday, February 9, 2018 4:10 PM

All replies

  • Try this expression:


    But you can also add the following lines at the beginning of the files:

       Option Strict On

       Option Infer Off


    There are corresponding compiler options.

    Friday, February 9, 2018 6:50 PM
  • Hi Doug Null,

    Would you please share the latest information about this issue in your side?

    Could you get useful information from Viorel_'s suggestion?

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Wednesday, February 14, 2018 5:45 AM