[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Tue Mar 30 12:13:32 2004 -->
- <!--x-from-r13: obo ng irelfrpheryvahk.pbz (Pbo Fbkra) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] sed & regex -->
- <li><em>date</em>: Tue Mar 30 12:13:32 2004</li>
- <li><em>from</em>: bob at verysecurelinux.com (Bob Toxen)</li>
- <li><em>in-reply-to</em>: <<a href="msg01080.html">[email protected]</a>></li>
- <li><em>references</em>: <<a href="msg01080.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] sed & regex</li>
Mastering Regular Expressions (2nd Edition)
by Jeffrey Friedl
O'Reilly
2002
It covers not just grep, sed, and Perl but also the Dark Side.
I have a copy.
Bob Toxen
bob at verysecurelinux.com [Please use for email to me]
<a rel="nofollow" href="http://www.verysecurelinux.com">http://www.verysecurelinux.com</a> [Network&Linux/Unix security consulting]
<a rel="nofollow" href="http://www.realworldlinuxsecurity.com">http://www.realworldlinuxsecurity.com</a> [My book:"Real World Linux Security 2/e"]
Quality Linux & UNIX security and SysAdmin & software consulting since 1990.
"Microsoft: Unsafe at any clock speed!"
-- Bob Toxen 10/03/2002
On Tue, Mar 30, 2004 at 11:42:04PM +0900, Keith Hopkins wrote:
> Hi folks,
>
> 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
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> <a rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale">http://www.ale.org/mailman/listinfo/ale</a>
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="01080" href="msg01080.html">[ale] sed & regex</a></strong>
<ul><li><em>From:</em> hne at hopnet.net (Keith Hopkins)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg01096.html">[ale] STORY LINK: Vendor slammed for 'selling' patches</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg01098.html">[ale] STORY LINK: Vendor slammed for 'selling' patches</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg01131.html">[ale] sed & regex</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg01085.html">[ale] lnx-bbc + serial console</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#01097"><strong>Date</strong></a></li>
<li><a href="threads.html#01097"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>