Ruby正则表达式提取子字符串代码: str = '(800)555-1212' m = str.match(/\((\d+)\)(\d+)-(\d+)/).captures a,b,c = m.captures