Method: Landline::PatternMatching::ReMatch#match

Defined in:
lib/landline/pattern_matching/rematch.rb

#match(input) ⇒ Array(String,Array,Hash), FalseClass

Match the string and assign matches to parameters. Returns:

  • Unmatched part of a string

  • Unnamed parameters

  • Named parameters

Parameters:

  • input (String)

    String to match

Returns:

  • (Array(String,Array,Hash))
  • (FalseClass)

    if input doesn’t match regexp



26
27
28
29
30
31
# File 'lib/landline/pattern_matching/rematch.rb', line 26

def match(input)
  result = Landline::PatternMatching.canonicalize(input).match(@glob)
  return false unless result

  [result.post_match, result.captures, result.named_captures]
end