Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm fuddling my way through using regular expressions in notepad++ with some .xml files, and may have gotten a little over my head.

I'm currently trying to search for anything that starts with:

<text id="name">Timer</text>   (where "Timer" is a random word\s)

and replace with

<text id="name">Timer</text><text id="MyRule">1.rule</text> 

1.rule would be used in all follow up instances of the search, the only random factor is the word between the id=name and the close of the text.

Another Example would be:

<text id="name">start up changes</text>

and i'm looking to replace to

 <text id="name">start up changes</text><text id="MyRule">1.rule</text>

Is there a simple regular expression that can find these random word or words, and then apply my changes after that expression. Any help would be greatly appreciated.

share|improve this question

1 Answer 1

I don't have access to NotePad++ right now to double-check, but try the following:

Search: (<text.*?/text>)

Replace: \1<text id="MyRule">1.rule</text>

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.