Community
    • Login

    find and replace Gemini copy/paste coding data-path-to-node

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 421 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.
    • Omar AO Offline
      Omar A
      last edited by

      Hi,

      Here’s the code that I copied from Google Gemini into WordPress.

      As you can see, each <span data-path-to-node=“11,1,0,0”> is different.

      I can easily find/replace <span data-path-to-node=> as that’s consistent, but the numbers are all different. How can I delete the entire <span> as it’s bloat?

      	<tr>
      		<td width="25%"><span data-path-to-node="11,1,0,0"><b data-path-to-node="11,1,0,0" data-index-in-node="0">Identifiers</b> Name</span></td>
      		<td width="25%"><span data-path-to-node="11,1,1,0">You</span></td>
      		<td width="25%"><span data-path-to-node="11,1,2,0">Ads</span></td>
      		<td width="25%"><span data-path-to-node="11,1,3,0">Service /span></td>
        </tr>
      

      Thanks
      Omar

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP Offline
        PeterJones @Omar A
        last edited by PeterJones

        @Omar-A ,

        Search has a “regular expression” mode which will be able to search for anything matching a pattern. Since I assume you want to also delete the matching </span> to go with it, then I believe a regex like the following will work:
        FIND = <span data-path-to-node[^>]*>(.*?)</span>
        REPLACE = $1
        SEARCH MODE = Regular Expression

        That worked on the first three spans in your example (and would’ve worked on the fourth if the final /span> wasn’t missing the <)

        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