سؤال

I need to find all instances of type xxx::Box in a VC++ solution. Searching for "xxx::Box" is easy, but often the namespace isn't used... searching for "Box" also matches

  • GetBoundingBox()
  • *pBox
  • //how many Boxes
  • etc

I was wondering if the weird VS regex searching could help me, but I'm not sure. How can I only search for Box when it could be at the start of a line, or a parameter type, etc?

هل كانت مفيدة؟

المحلول

You can use word boundaries (denoted by \b) around the literal Box to only match the word "Box" (and not "Boxes" or "pBox" or some other prefix/suffix):

\bBox\b
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top