<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>InfoSauce: Ruby Conveniences</title>
    <link>http://blog.infosauce.com/articles/2006/02/01/ruby-conveniences</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Ruby Conveniences</title>
      <description>&lt;p&gt;Unbeknownst to me, there�s a quick way of doing a match &amp;amp; replace on a string in Ruby using just the brackets: (page 588 in the Ruby Book)&lt;/p&gt;

&lt;code style="font-size: 12px;"&gt;a = "bla bla bla"&lt;/code&gt;&lt;br&gt;
&lt;code style="font-size: 12px;"&gt;a[/a/i]="A"&lt;/code&gt;&lt;br&gt;
&lt;code style="font-size: 12px;"&gt;a =&amp;amp;gt; "blA bla bla"&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
Unfortunately it only does one replace instead of a global replace, but I don�t know enough about RegExp�s now to know if there�s a way to do a global replace with this?
</description>
      <pubDate>Wed, 01 Feb 2006 23:49:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:16244861-2b0a-48d0-97a9-2aae95529195</guid>
      <author>Tieg Zaharia</author>
      <link>http://blog.infosauce.com/articles/2006/02/01/ruby-conveniences</link>
      <category>Ruby</category>
    </item>
    <item>
      <title>"Ruby Conveniences" by PJ Hyett</title>
      <description>&lt;p&gt;a.gsub(/a/,’A’)&lt;/p&gt;</description>
      <pubDate>Fri, 03 Feb 2006 23:59:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:15dd736c-51d1-459e-b0f5-70d12e1cd8c2</guid>
      <link>http://blog.infosauce.com/articles/2006/02/01/ruby-conveniences#comment-21</link>
    </item>
    <item>
      <title>"Ruby Conveniences" by Tim Connor</title>
      <description>&lt;p&gt;I guess I’m wrong – ruby doesn’t seem to support the g option. That’s lame.&lt;/p&gt;</description>
      <pubDate>Thu, 02 Feb 2006 00:07:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:af28924d-bb4d-4c7c-881b-0b5af1d8b5dc</guid>
      <link>http://blog.infosauce.com/articles/2006/02/01/ruby-conveniences#comment-20</link>
    </item>
    <item>
      <title>"Ruby Conveniences" by Tim Connor</title>
      <description>&lt;p&gt;It should be /a/ig, I believe, for global (i is ignore case, g is global)&lt;/p&gt;</description>
      <pubDate>Wed, 01 Feb 2006 23:59:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:2207fb49-afe9-4056-bbb2-b1c4edba2476</guid>
      <link>http://blog.infosauce.com/articles/2006/02/01/ruby-conveniences#comment-19</link>
    </item>
  </channel>
</rss>
