[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



  I hope someone can point me to the error of my ways....too difficult?  Ok, how about a hand at a regex problem?

  I have some xml files I'm trying to convert for local browsing.  "wget -m -k" almost does the trick, but the remaining files have this snippet left in them...

"handbook.xml?part" as part of an href.  The actual files have "?" in their names.  If I convert the href from "?" to "%3F" then my browser is all happy and finds the files (otherwise, it prints nasty errors).

  The question is, how to replace all the "?" with "%3F".  I tried `sed` since that seemed to be the natural solution, but it isn't working like I expected.

  I do this...

sed "s/handbook.xml\?/handbook.xml\%3F/" handbook.xml > handbook.html

  and sed really converts the string to "handbook.xml??"

  Where is the extra "?" coming from??

  Alternately, I tried
sed "s/handbook.xml\?part/handbook.xml\%3Fpart/" handbook.xml > handbook.html
  and that seems to work OK (for those lines that actually have "part" in them).

-- 
Lost in Tokyo,
  Keith


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="01082" href="msg01082.html">[ale] sed &amp; regex</a></strong>
<ul><li><em>From:</em> pete.hardie at sciatl.com (Pete Hardie)</li></ul></li>
<li><strong><a name="01084" href="msg01084.html">[ale] sed &amp; regex</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
<li><strong><a name="01097" href="msg01097.html">[ale] sed &amp; regex</a></strong>
<ul><li><em>From:</em> bob at verysecurelinux.com (Bob Toxen)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg01079.html">[ale] New Hardware</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg01081.html">[ale] New Hardware</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg01077.html">[ale] Fedora Core2 Test2 ISOs</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg01082.html">[ale] sed &amp; regex</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#01080"><strong>Date</strong></a></li>
<li><a href="threads.html#01080"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>