Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. How to NOT find in comments? [modified]

How to NOT find in comments? [modified]

Scheduled Pinned Locked Moved The Lounge
visual-studiotutorialcsharpalgorithmsquestion
8 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ajay Vijayvargiya
    wrote on last edited by
    #1

    In Visual Studio, any version, any programming language, with any available add-in - Is it possible to omit the comments for searching. Yes, you probably got it right. For example:

    int main()
    {
    // this is main function which calls printf three times
    printf("three");
    printf("three");
    printf("three");
    }

    And if I search 'three', 'printf' or other term that is ALSO in comment - VS will goto commented part as well which I dont want. Likewise, I may want to search only in comments. Or only/not-in strings.

    modified on Thursday, January 20, 2011 11:09 AM

    B X Y 3 Replies Last reply
    0
    • A Ajay Vijayvargiya

      In Visual Studio, any version, any programming language, with any available add-in - Is it possible to omit the comments for searching. Yes, you probably got it right. For example:

      int main()
      {
      // this is main function which calls printf three times
      printf("three");
      printf("three");
      printf("three");
      }

      And if I search 'three', 'printf' or other term that is ALSO in comment - VS will goto commented part as well which I dont want. Likewise, I may want to search only in comments. Or only/not-in strings.

      modified on Thursday, January 20, 2011 11:09 AM

      B Offline
      B Offline
      Bassam Abdul Baki
      wrote on last edited by
      #2

      Not really. You can either use a regular expression if the comment is // or use "Find All References" for searching only in that class. In Word, you can do a search for text color. I don't think Visual Studio has formatting search.

      A 1 Reply Last reply
      0
      • A Ajay Vijayvargiya

        In Visual Studio, any version, any programming language, with any available add-in - Is it possible to omit the comments for searching. Yes, you probably got it right. For example:

        int main()
        {
        // this is main function which calls printf three times
        printf("three");
        printf("three");
        printf("three");
        }

        And if I search 'three', 'printf' or other term that is ALSO in comment - VS will goto commented part as well which I dont want. Likewise, I may want to search only in comments. Or only/not-in strings.

        modified on Thursday, January 20, 2011 11:09 AM

        X Offline
        X Offline
        Xiangyang Liu
        wrote on last edited by
        #3

        Ajay Vijayvargiya wrote:

        int main() { // this is main function which calls printf three times printf("three"); }

        If you omit comment, how do you find out that your comment is wrong? printf("three"); is not the same as calling printf three times. :)

        My Younger Son & His "PET"

        A 1 Reply Last reply
        0
        • B Bassam Abdul Baki

          Not really. You can either use a regular expression if the comment is // or use "Find All References" for searching only in that class. In Word, you can do a search for text color. I don't think Visual Studio has formatting search.

          A Offline
          A Offline
          Ajay Vijayvargiya
          wrote on last edited by
          #4

          VS doesn't have formatting search! Finding references doesn't solve the purpose. I may need to find symbols having specific words, and I want to avoid all comments. Or take it other way: I want to find some text embedded in string.

          B 1 Reply Last reply
          0
          • X Xiangyang Liu

            Ajay Vijayvargiya wrote:

            int main() { // this is main function which calls printf three times printf("three"); }

            If you omit comment, how do you find out that your comment is wrong? printf("three"); is not the same as calling printf three times. :)

            My Younger Son & His "PET"

            A Offline
            A Offline
            Ajay Vijayvargiya
            wrote on last edited by
            #5

            Yeah.. ! ;P

            1 Reply Last reply
            0
            • A Ajay Vijayvargiya

              In Visual Studio, any version, any programming language, with any available add-in - Is it possible to omit the comments for searching. Yes, you probably got it right. For example:

              int main()
              {
              // this is main function which calls printf three times
              printf("three");
              printf("three");
              printf("three");
              }

              And if I search 'three', 'printf' or other term that is ALSO in comment - VS will goto commented part as well which I dont want. Likewise, I may want to search only in comments. Or only/not-in strings.

              modified on Thursday, January 20, 2011 11:09 AM

              Y Offline
              Y Offline
              Yusuf
              wrote on last edited by
              #6

              Ajay Vijayvargiya wrote:

              // this is main function which calls printf three times printf("three");

              Is this the new feature of .NET? printf("three") calls printf three times? :rolleyes:

              Yusuf May I help you?

              A 1 Reply Last reply
              0
              • Y Yusuf

                Ajay Vijayvargiya wrote:

                // this is main function which calls printf three times printf("three");

                Is this the new feature of .NET? printf("three") calls printf three times? :rolleyes:

                Yusuf May I help you?

                A Offline
                A Offline
                Ajay Vijayvargiya
                wrote on last edited by
                #7

                With number-text parsing and recursion, yes! ;P

                1 Reply Last reply
                0
                • A Ajay Vijayvargiya

                  VS doesn't have formatting search! Finding references doesn't solve the purpose. I may need to find symbols having specific words, and I want to avoid all comments. Or take it other way: I want to find some text embedded in string.

                  B Offline
                  B Offline
                  Bassam Abdul Baki
                  wrote on last edited by
                  #8

                  Like I said, no, not really.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups