• Login
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.
  • E
    Eric Cox
    last edited by Nov 3, 2022, 1:10 PM

    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

    P 1 Reply Last reply Nov 3, 2022, 2:07 PM Reply Quote 0
    • P
      Paul Wormer @Eric Cox
      last edited by Nov 3, 2022, 2:07 PM

      @Eric-Cox Did you check Regular Expression?

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

      1 Reply Last reply Reply Quote 1
      • E
        Eric Cox
        last edited by Nov 3, 2022, 2:26 PM

        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
        • E
          Eric Cox
          last edited by Nov 3, 2022, 2:35 PM

          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 #.

          A 1 Reply Last reply Nov 3, 2022, 2:46 PM Reply Quote 0
          • E
            Eric Cox
            last edited by Nov 3, 2022, 2:36 PM

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

            " # POST:"

            A 1 Reply Last reply Nov 3, 2022, 2:45 PM Reply Quote 1
            • A
              Alan Kilborn @Eric Cox
              last edited by Nov 3, 2022, 2:45 PM

              @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
              • A
                Alan Kilborn @Eric Cox
                last edited by Alan Kilborn Nov 3, 2022, 2:48 PM Nov 3, 2022, 2:46 PM

                @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
                • E
                  Eric Cox
                  last edited by Nov 3, 2022, 3:15 PM

                  That worked. You are the best!!!

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