Community
    • Login

    Find Lines starting with #

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 3 Posters 16.2k Views
    Loading More Posts
    • 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.
    • Eric CoxE
      Eric Cox
      last edited by

      To all,

      I’m following the examples online but am having no luck finding lines that start with #.

      Here is a sample line:
      # post:

      I have thousands of lines I want to find and remove.

      I’m using Notepad++ 8.4.5.

      Can someone help me with a working example of how to find and mark lines start with #? I’ve tried all sorts of variations of ^#, ^[#], ^[#].* but nothing is finding the lines.

      Thanks very much in advance,
      EC

      Paul WormerP 1 Reply Last reply Reply Quote 0
      • Paul WormerP
        Paul Wormer @Eric Cox
        last edited by

        @Eric-Cox Did you check Regular Expression?

        fa8d445c-0b76-4e9d-9c3e-fa35f7129c9f-afbeelding.png

        1 Reply Last reply Reply Quote 1
        • Eric CoxE
          Eric Cox
          last edited by

          Yes, I have the Mark and Find exactly as you show but it doesn’t find any matches in the source file.

          The Regular Expression radio button is selected and the Find what: ^# is exactly as you show. I’m not sure what I’m doing wrong.

          1 Reply Last reply Reply Quote 0
          • Eric CoxE
            Eric Cox
            last edited by

            I see what might be the problem.

            POST:

            Notice the # is not the first character on the line. It is the third character.

            Refining my Find: I need to find all lines where the first character is # regardless of empty blank spaces before the #.

            Alan KilbornA 1 Reply Last reply Reply Quote 0
            • Eric CoxE
              Eric Cox
              last edited by

              It looks like the unquoted # is markup in the web site.

              " # POST:"

              Alan KilbornA 1 Reply Last reply Reply Quote 1
              • Alan KilbornA
                Alan Kilborn @Eric Cox
                last edited by

                @Eric-Cox said in Find Lines starting with #:

                It looks like the unquoted # is markup in the web site.

                This could have been avoided if you’d noticed the FAQ.

                1 Reply Last reply Reply Quote 0
                • Alan KilbornA
                  Alan Kilborn @Eric Cox
                  last edited by Alan Kilborn

                  @Eric-Cox said in Find Lines starting with #:

                  I need to find all lines where the first character is # regardless of empty blank spaces before the #

                  Find: ^\h*#

                  But I’m sure the purists reading this won’t like that, so this is really more of exactly what you asked for:

                  Find: ^\x20*#

                  BTW, thanks for clarifying your questions by posting additional times rather than editing older posts. Doing it the way you did makes it SO much clearer how your question evolved.

                  1 Reply Last reply Reply Quote 1
                  • Eric CoxE
                    Eric Cox
                    last edited by

                    That worked. You are the best!!!

                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors