<div class="gmail_quote">On Thu, Jun 18, 2009 at 1:46 PM, chris <span dir="ltr"><<a href="mailto:chris@ia.gov">chris@ia.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">> end. I need to remove<br>
> <key>remote-id</key><br>
> <string>4294</string><br><br>
</div>If I understand what you need this may work, if not tell me w where I went wrong and I'll fix it.<br>
<br>
perl -p -i -e 's/<(key|string)>.+<\/(key|string)>//' *<br>
<br>
<br>
That'll *modify the original file* in place and leave a blank line where any<br>
<br>
<key>.+</key><br>
<string>.+</string><br>
<br></blockquote></div><br clear="all">Well, that could cause problems if there are other tags between the end of </key> and beginning of </string> since the regex will be greedy. It will actually match <key>.+</strong><div>
<br></div><div>So <(key|string)>[^<]+</(key|string)> would work better, right?</div><div><br>-- <br>Matthew Nuzum<br>newz2000 on freenode, skype, linkedin, <a href="http://identi.ca">identi.ca</a> and twitter<br>
</div>