I've got several files that have double tags in them (either on purpose or by accident). I'm looking to find the first occurrence only of the tag and append it with additional HTML code. But the second occurrence shouldn't be affected. I'm using TextWrangler. The regex I'm using now replaces both occurrences rather than just the first.
<body someattribute=...> existing content <body onUnload=...>
RegEx I'm using:
Find: (\<body.*\>) Replace with: \n\1 appended HTML code
<body someattribute=...> appended HTML code existing content <body onUnload=...> appended HTML code
So it's adding my appended code twice. I just want it to happen to the first only.