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