<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>hgq114</title>
    <link>https://ruby-china.org/hgq114</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>如何用正则表达式获取页数</title>
      <description>&lt;p&gt;[ 总数：5, 共 1 页 ]   每页显示：20 50 100&lt;/p&gt;

&lt;p&gt;想用正则获取到页数“5”，请达人指教&lt;/p&gt;</description>
      <author>hgq114</author>
      <pubDate>Fri, 12 Apr 2013 16:36:02 +0800</pubDate>
      <link>https://ruby-china.org/topics/10138</link>
      <guid>https://ruby-china.org/topics/10138</guid>
    </item>
    <item>
      <title>如何判断字符串中包含数字？</title>
      <description>&lt;p&gt;学习 Learn Ruby The Hard Way 的时候看到这样一段代码：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;next_move&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;gets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;chomp&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;next_move&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;include?&lt;/span&gt; &lt;span class="s2"&gt;"0"&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;next_move&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;include?&lt;/span&gt; &lt;span class="s2"&gt;"1"&lt;/span&gt;
  &lt;span class="n"&gt;how_much&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;next_move&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_i&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
  &lt;span class="n"&gt;dead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Man, learn to type a number."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;endm&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;next_move.include? "0" or next_move.include? "1" 这个式子怎么用更简单的方式来代替呢？要能直接判断字符串中包含数字&lt;/p&gt;</description>
      <author>hgq114</author>
      <pubDate>Thu, 21 Feb 2013 15:45:08 +0800</pubDate>
      <link>https://ruby-china.org/topics/8826</link>
      <guid>https://ruby-china.org/topics/8826</guid>
    </item>
  </channel>
</rss>
