Community
    • Login

    How to get search partially instead of exact match?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 3 Posters 2.5k Views 2 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.
    • LogeshNguhanL Offline
      LogeshNguhan
      last edited by

      The text file:
      3005490
      3032390
      3053390
      3090546
      3090452
      3090234
      If I search for “3090”, the output would be,
      3090546
      3090452
      3090234

      But I want results like,
      3005490
      3032390
      3053390
      3090546
      3090452
      3090234

      Please help me on this, thanks.

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @LogeshNguhan
        last edited by Alan Kilborn

        @LogeshNguhan

        Find: 30\d*?90
        Search mode: Regular expression

        If your goal is to have N++ highlight only those parts you have shown as bolded, in its Search results window or when you use Find Next, then sorry, you’re not going to get that.

        Additional REFerence. And another ONE.

        LogeshNguhanL Neil SchipperN 2 Replies Last reply Reply Quote 4
        • LogeshNguhanL Offline
          LogeshNguhan @Alan Kilborn
          last edited by

          @Alan-Kilborn Thanks for the help. It helped to find all the lines with ‘3090’.
          But is there any way to find only the lines that start with ‘30’ and end with ‘90’?
          (i.e) it should not return result like,
          3009056

          Alan KilbornA 1 Reply Last reply Reply Quote 0
          • Alan KilbornA Offline
            Alan Kilborn @LogeshNguhan
            last edited by

            @LogeshNguhan said in How to get search partially instead of exact match?:

            is there any way to find only the lines that start with ‘30’ and end with ‘90’?

            Yes, there is. Did you have a look at the references I supplied to you in my previous post?

            LogeshNguhanL 1 Reply Last reply Reply Quote 3
            • LogeshNguhanL Offline
              LogeshNguhan @Alan Kilborn
              last edited by

              @Alan-Kilborn It took some time to understand. Now I got the answer.

              ^30\d*90$

              Thanks.

              1 Reply Last reply Reply Quote 3
              • Neil SchipperN Offline
                Neil Schipper @Alan Kilborn
                last edited by Neil Schipper

                @Alan-Kilborn @LogeshNguhan

                If your goal is to have N++ highlight only those parts you have shown as bolded…

                This could be achieved by using a suitable regex with a logical or directive and Mark All.

                Alan KilbornA 1 Reply Last reply Reply Quote 0
                • Alan KilbornA Offline
                  Alan Kilborn @Neil Schipper
                  last edited by

                  @Neil-Schipper said in How to get search partially instead of exact match?:

                  This could be achieved by using a suitable regex with a logical or directive and Mark All.

                  I meant when using the simple regex I supplied.

                  1 Reply Last reply Reply Quote 0

                  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