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



  • 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.



  • @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.


Log in to reply