Community
    • Login

    Find Lines starting with #

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 3 Posters 24.5k Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          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 Offline
            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 Offline
              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 Offline
                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 Offline
                  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 Offline
                    Eric Cox
                    last edited by

                    That worked. You are the best!!!

                    1 Reply Last reply Reply Quote 1

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors