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

[no subject]



     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&amp;Linux/Unix security consulting]
<a  rel="nofollow" href="http://www.realworldlinuxsecurity.com";>http://www.realworldlinuxsecurity.com</a> [My book:&quot;Real World Linux Security 2/e&quot;]
Quality Linux &amp; UNIX security and SysAdmin &amp; software consulting since 1990.

&quot;Microsoft: Unsafe at any clock speed!&quot;
   -- Bob Toxen 10/03/2002

On Tue, Mar 30, 2004 at 11:42:04PM +0900, Keith Hopkins wrote:
&gt; Hi folks,
&gt; 
&gt;   I hope someone can point me to the error of my ways....too difficult?  Ok, how about a hand at a regex problem?
&gt; 
&gt;   I have some xml files I'm trying to convert for local browsing.  &quot;wget -m -k&quot; almost does the trick, but the remaining files have this snippet left in them...
&gt; 
&gt; &quot;handbook.xml?part&quot; as part of an href.  The actual files have &quot;?&quot; in their names.  If I convert the href from &quot;?&quot; to &quot;%3F&quot; then my browser is all happy and finds the files (otherwise, it prints nasty errors).
&gt; 
&gt;   The question is, how to replace all the &quot;?&quot; with &quot;%3F&quot;.  I tried `sed` since that seemed to be the natural solution, but it isn't working like I expected.
&gt; 
&gt;   I do this...
&gt; 
&gt; sed &quot;s/handbook.xml\?/handbook.xml\%3F/&quot; handbook.xml &gt; handbook.html
&gt; 
&gt;   and sed really converts the string to &quot;handbook.xml??&quot;
&gt; 
&gt;   Where is the extra &quot;?&quot; coming from??
&gt; 
&gt;   Alternately, I tried
&gt; sed &quot;s/handbook.xml\?part/handbook.xml\%3Fpart/&quot; handbook.xml &gt; handbook.html
&gt;   and that seems to work OK (for those lines that actually have &quot;part&quot; in them).
&gt; 
&gt; -- 
&gt; Lost in Tokyo,
&gt;   Keith
&gt; 
&gt; _______________________________________________
&gt; Ale mailing list
&gt; Ale at ale.org
&gt; <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 &amp; 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 &amp; 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>