Reputation: 35
Im trying to search and replace parts of a huge xml file and am stuck with getting a correct regular expression for something like this
<Start id="AUTO_TEXT"...>
MORE TEXT
MORE TEXT
</Start>
I always end up writing something like this, which isn't working:
<Start id="AUTO_[^/r]*<\/Start>
What am I missing?
Oh, I'm using EditPad Pro which uses the "The Just Great Software Regular Expression Engine" (Wow, what a name)
Upvotes: 0
Views: 159
Reputation: 41838
Tested in EditPadPro:
(?s)<Start id="AUTO.*?</Start>
Explanation
(?s)
activates DOTALL
mode, allowing the dot to match across lines.*?
is made "lazy" by the ?
so that the dot only matches as many characters as needed to allow the next token to match (shortest match).Option 2
Instead of using (?s)
, you can also press the Dot
toggle in the search bar.
Upvotes: 1