matched

Synopsis

@ matched()

returns the matches from a "string" applied to a regex 'pattern' during an ismatch/hasmatch check

Examples

if ("(654) 555-1212" ismatch '\((\d\d\d)\) (\d\d\d-\d\d\d\d)') { ($areaCode, $phoneNumber) = matched(); println("dial 1 and $areaCode before $phoneNumber"); }

dial 1 and 654 before 555-1212

See Also