refactor: supports regular expressions in pattern_matching_spec.rb