rxp =~ str â integer or nil
Instance Public methods
MatchâMatches rxp against str.
/at/ =~ "input data" #=> 7
/ax/ =~ "input data" #=> nil
If =~ is used with a regexp literal with named captures,
captured strings (or nil) is assigned to local variables named by the
capture names.
/(?<lhs>\w+)\s*=\s*(?<rhs>\w+)/ =~ " x = y "
p lhs #=> "x"
p rhs #=> "y"
If it is not matched, nil is assigned for the variables.
/(?<lhs>\w+)\s*=\s*(?<rh