• Login
Community
  • Login

How to get search partially instead of exact match?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
7 Posts 3 Posters 1.1k 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.
  • L
    LogeshNguhan
    last edited by Mar 18, 2023, 1:55 PM

    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.

    A 1 Reply Last reply Mar 18, 2023, 3:08 PM Reply Quote 0
    • A
      Alan Kilborn @LogeshNguhan
      last edited by Alan Kilborn Mar 18, 2023, 3:09 PM Mar 18, 2023, 3:08 PM

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

      L N 2 Replies Last reply Mar 19, 2023, 1:21 PM Reply Quote 4
      • L
        LogeshNguhan @Alan Kilborn
        last edited by Mar 19, 2023, 1:21 PM

        @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

        A 1 Reply Last reply Mar 19, 2023, 1:34 PM Reply Quote 0
        • A
          Alan Kilborn @LogeshNguhan
          last edited by Mar 19, 2023, 1:34 PM

          @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?

          L 1 Reply Last reply Mar 19, 2023, 2:23 PM Reply Quote 3
          • L
            LogeshNguhan @Alan Kilborn
            last edited by Mar 19, 2023, 2:23 PM

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

            ^30\d*90$

            Thanks.

            1 Reply Last reply Reply Quote 3
            • N
              Neil Schipper @Alan Kilborn
              last edited by Neil Schipper Mar 20, 2023, 3:39 AM Mar 20, 2023, 3:38 AM

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

              A 1 Reply Last reply Mar 20, 2023, 11:34 AM Reply Quote 0
              • A
                Alan Kilborn @Neil Schipper
                last edited by Mar 20, 2023, 11:34 AM

                @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
                3 out of 7
                • First post
                  3/7
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors