Hatena::Grouprubyist

Rubyをラクガク(正規表現編) RSSフィード

2009-12-16

[] 最短一致: *?  最短一致: *? - Rubyをラクガク(正規表現編) を含むブックマーク はてなブックマーク -  最短一致: *? - Rubyをラクガク(正規表現編)  最短一致: *? - Rubyをラクガク(正規表現編) のブックマークコメント

*?

量指定子(quantifiers)。直前の表現の 0 回以上の繰り返し (最短一致)

プログラミング言語 Ruby リファレンスマニュアル
irb(main):015:0> puts "/'(.*)'/ =~ 'hoge''foo''bar': #{/'(.*)'/ =~ "'hoge''foo''bar'"}" /'(.*)'/ =~ 'hoge''foo''bar': 0
=> nil
irb(main):016:0> $1
=> "hoge''foo''bar"
irb(main):017:0> puts "/'(.*?)'/ =~ 'hoge''foo''bar': #{/'(.*?)'/ =~ "'hoge''foo''bar'"}" /'(.*?)'/ =~ 'hoge''foo''bar': 0
=> nil
irb(main):018:0> $1
=> "hoge"

正規表現初心者は、最短一致の方が直感的に理解しやすいと思う。

KaressKaress 2016/05/07 16:04 yo sh1ldunRo7;t encrypt your back ups before they leave your facilities. S3 can encrypt using AES at the file system level, but it is ultimately to the consumer to determine what level of security is necessary for their backups. The technology is there, it’s up to us to find ways to use it effectively.

JacieJacie 2016/05/09 10:37 Scrivi il tuo commento Puoi usare questi tags HTML : <a> <abbr> <acronym> <b> <a href="http://bhkfwp.com">&l;okltcbquote></a> <cite> <code> <del> <em> <i> <q> <strike> <strong> var RecaptchaOptions = { theme : 'red', lang : 'en' , tabindex : 5 };   #submit {display:none;}

Johnb487Johnb487 2016/05/30 17:02 I like this post, enjoyed this one regards for putting up. The goal of revival is conformity to the image of Christ, not imitation of animals. by Richard F. Lovelace. aecbcfdaeadd

Pharmf250Pharmf250 2016/05/31 07:16 Very nice site! <a href="http://opeyixa2.com/qovao/1.html">cheap goods</a>

Pharmg873Pharmg873 2016/05/31 07:17 Very nice site! [url=http://opeyixa2.com/qovao/2.html]cheap goods[/url]

Pharmd301Pharmd301 2016/05/31 07:18 Very nice site! cheap goods http://opeyixa2.com/qovao/4.html

Pharmd602Pharmd602 2016/05/31 07:18 Very nice site!

Pharme937Pharme937 2016/06/01 13:29 Very nice site! <a href="http://ypxoiea2.com/qyatxq/1.html">cheap goods</a>

Pharmf964Pharmf964 2016/06/01 13:30 Very nice site! [url=http://ypxoiea2.com/qyatxq/2.html]cheap goods[/url]

Pharme378Pharme378 2016/06/01 13:31 Very nice site! cheap goods http://ypxoiea2.com/qyatxq/4.html

Pharmf858Pharmf858 2016/06/01 13:31 Very nice site!

Pharmk709Pharmk709 2016/06/02 19:30 Very nice site! <a href="http://apxoiey2.com/aovax/1.html">cheap goods</a>

Pharmd501Pharmd501 2016/06/02 19:31 Very nice site! [url=http://apxoiey2.com/aovax/2.html]cheap goods[/url]

Pharmg879Pharmg879 2016/06/02 19:32 Very nice site! cheap goods http://apxoiey2.com/aovax/4.html

Pharmk873Pharmk873 2016/06/02 19:33 Very nice site!

Pharmg668Pharmg668 2016/06/04 01:32 Very nice site! [url=http://apeoixy2.com/tqsvv/2.html]cheap goods[/url]

Pharmc634Pharmc634 2016/06/04 01:33 Very nice site! cheap goods http://apeoixy2.com/tqsvv/4.html

Pharmf696Pharmf696 2016/06/04 01:34 Very nice site!

Pharmk414Pharmk414 2016/06/05 07:40 Very nice site! [url=http://aixypeo2.com/ayatxa/2.html]cheap goods[/url]

Pharmf127Pharmf127 2016/06/05 07:41 Very nice site! cheap goods http://aixypeo2.com/ayatxa/4.html

Pharmd107Pharmd107 2016/06/05 07:42 Very nice site!

Pharmd759Pharmd759 2016/06/06 13:38 Very nice site! <a href="http://yieapxo2.com/qoqsv/1.html">cheap goods</a>

Pharma952Pharma952 2016/06/06 13:39 Very nice site! [url=http://yieapxo2.com/qoqsv/2.html]cheap goods[/url]

Pharmg913Pharmg913 2016/06/06 13:40 Very nice site! cheap goods http://yieapxo2.com/qoqsv/4.html

Pharmd32Pharmd32 2016/06/06 13:40 Very nice site!

Pharmf637Pharmf637 2016/06/07 19:56 Very nice site! <a href="http://oieapxy2.com/tyatxt/1.html">cheap goods</a>

Pharmg335Pharmg335 2016/06/07 19:57 Very nice site! [url=http://oieapxy2.com/tyatxt/2.html]cheap goods[/url]

Pharmd873Pharmd873 2016/06/07 20:00 Very nice site! cheap goods http://oieapxy2.com/tyatxt/4.html

Pharme323Pharme323 2016/06/07 20:01 Very nice site!

ゲスト



トラックバック - http://rubyist.g.hatena.ne.jp/hsyd/20091216