Changeset 8727 in project


Ignore:
Timestamp:
02/23/08 22:53:36 (12 years ago)
Author:
sjamaan
Message:

Changes applied for sjamaan (80.126.188.214) through svnwiki:

Shorten the regex match example of Ruby

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/chicken-for-ruby-programmers

    r8726 r8727  
    648648Ruby:
    649649
    650    m = /(.)(.)(\d+)(\d)/.match("THX1138.")
    651    m[0]       #=> "HX1138"
    652    m[1, 2]    #=> ["H", "X"]
    653    m[1..3]    #=> ["H", "X", "113"]
    654    m[-3, 2]   #=> ["X", "113"]
     650  irb(main):001:0> /(.)(.)(\d+)(\d)/.match("THX1138.").to_a
     651  => ["HX1138", "H", "X", "113", "8"]
    655652
    656653Chicken:
Note: See TracChangeset for help on using the changeset viewer.