WordEx is a word based pattern matching library. It is similar to Regexp. But while Regexp matches individual characters, WordEx is built to match word sequences.
WordEx.new("I saw them playing :game yesterday").
match("I saw them playing tennis yesterday")
# => {:game => "tennis"}
WordEx.new("I saw them +doing yesterday").
match("I saw them playing tennis yesterday")
# => {:doing=>"playing tennis"}
WordEx.new("I have :apple_count@Integer apples").
match("I have 5 apples")
# => {:apple_count=>5}
WordEx.new("I have :apple_count@Integer apples").
match("I have many apples")
# => nil
WordEx.new("I have :apple_count@+Integer apples").
match("I have -5 apples")
# => nil