Navigation

    Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

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

    Help wanted · · · – – – · · ·
    2
    2
    275
    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 Donaldson
      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 Kilborn 1 Reply Last reply Reply Quote 0
      • Alan Kilborn
        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
        Copyright © 2014 NodeBB Forums | Contributors