Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


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.