Large cup of coke,
Medium cup of coke,
Small cup of spriteand
Medium cup of Fanta. We know that there are two basic features in these phrases:
the size of the cupand
the type of the drink.
Large, Medium and Smallinto one group, and
Coke, Sprite and Fantato another, we then have an essential rule of thumb for this kind of sentences.
hello!-> Match "hey hello" -> No Match
I want to eat-> Match “I want to eat food” -> No Match
clothes types, there are many ways of expressing:
typesmay rearrange into many possibilities. Therefore, we can use a regular expression to capture all the possibilities.