Community
    • Login

    How do I use replace to edit part of line with certain keywords?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 429 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.
    • Tim DonaldsonT
      Tim Donaldson
      last edited by Tim Donaldson

      I’ve googled to no avail, just fyi but I have a noob question. I am editing .xml files and in this .xml file there are a lot of entries that start with the same word which i want to change only part of the line and I don’t know how to do it.
      Original:
      <recipe name=“flagstoneArch” count=“2” craft_time=“3”>
      I want to replace all craft time entries that begin with “flagstone” to another number; say 12 up from 3. I am aware of the wildcard but all I’ve succeeded in doing is making it look like this:
      <recipe name=“flagstone.*” count=“2” craft_time=“12”> for every entry.

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Tim Donaldson
        last edited by

        @Tim-Donaldson

        Maybe try this:

        Bring up the Replace window (ctrl+h).
        Find what box: (?-is)(<recipe name=“flagstone.*?craft_time=“)\d+
        Replace with box: ${1}12
        Search mode: Regular expression
        Wrap around: ticked
        Press the Replace All button.

        1 Reply Last reply Reply Quote 2
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors