Community
    • Login

    Searching for between <STUFF> : Result goes beyond to include next argument

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 346 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.
    • Saragrace KnaufS Offline
      Saragrace Knauf
      last edited by PeterJones

      Notepad++ v8.7.5 (64-bit)
      Build time : Dec 21 2024 - 05:13:03
      Path : C:\Program Files\Notepad++\notepad++.exe
      Command Line :
      Admin mode : OFF
      Local Conf mode : OFF
      Cloud Config : OFF
      Periodic Backup : ON
      Placeholders : OFF
      DirectWrite : ON
      Multi-instance Mode : monoInst
      File Status Auto-Detection : cdEnabledNew (for current file/tab only)
      Dark Mode : OFF
      OS Name : Windows 11 Pro (64-bit)
      OS Version : 24H2
      OS Build : 26100.2894
      Current ANSI codepage : 1252
      Plugins :
      mimeTools (3.1)
      NppConverter (4.6)
      NppExport (0.4)
      Fellow Notepad++ Users,

      Could you please help me the the following search-and-MARK problem I am having?

      Here is the data I currently have (“before” data):

      <td colspan="4" width="2000" height="304"><font size="2">I</font>n another life,
      

      Here is how I would like that data to look (“after” data):

      <td colspan="4" width="2000" height="304">  (I want just this highlighted)
      

      highlightedText.png

      To accomplish this, I have tried using the following Find/Replace expressions and settings

      • Find What = <td .*>
      • Replace With = HIGHLIGHT/MARK
      • Search Mode = REGULAR EXPRESSION or NORMAL (tried both of these)
      • Dot Matches Newline = CHECKED or NOT CHECKED (I don’t see this option)

      HERE IS WHY YOU THOUGHT YOUR EXPRESSION WOULD WORK

      I understand why it is going beyond the first argument, I just don’t know how to limit it.

      Thank you in advance!

      PeterJonesP 1 Reply Last reply Reply Quote 1
      • PeterJonesP Offline
        PeterJones @Saragrace Knauf
        last edited by PeterJones

        @Saragrace-Knauf ,

        I just don’t know how to limit it.

        .* is greedy
        Try .*? which is non-grredy

        Saragrace KnaufS 1 Reply Last reply Reply Quote 2
        • Saragrace KnaufS Offline
          Saragrace Knauf @PeterJones
          last edited by

          @PeterJones

          .* is greedy
          Try .*? which is non-greedy

          That works perfectly. This also allowed me to go back to the instruction manual and find it. The “Multiplying Operators” threw me. I was looking for multiple characters after single characters!

          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