• Login
Community
  • Login

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

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 95 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.
  • S
    Saragrace Knauf
    last edited by PeterJones Jan 26, 2025, 3:27 PM Jan 26, 2025, 3:11 PM

    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!

    P 1 Reply Last reply Jan 26, 2025, 3:28 PM Reply Quote 1
    • P
      PeterJones @Saragrace Knauf
      last edited by PeterJones Jan 26, 2025, 3:29 PM Jan 26, 2025, 3:28 PM

      @Saragrace-Knauf ,

      I just don’t know how to limit it.

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

      S 1 Reply Last reply Jan 26, 2025, 4:20 PM Reply Quote 2
      • S
        Saragrace Knauf @PeterJones
        last edited by Jan 26, 2025, 4:20 PM

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