Contents

Roo

RegexMatch.captures

Returns an array comprising the value of each numbered capture group where captures(0) is group 1’s value, captures(1) is group 2’s value, etc. Returns an empty array if there are no capture groups.

var r = |(\w+)\.(\w+)@(\w+\.com)|
var t = "pepper.potts@stark.com"
t.match(r).first_match.captures # => ["pepper", "potts", "stark.com"]