Regular character:Fat | cat | belly | your
Characters to be tested:The dragging belly, indicates your cat is too fat
The first matching result is not "fat ".
", But" belly
".
Regular Expressions can also match fat and other possibilities, but they are not the first matching results (except the leftmost results), so they are not selected. All regular expressions may be tried before the next round. That is to say, before moving, fat, Cat, belly, and your must be tried.
By using regexbuddy debugging, we can see that (the language is Java), the Regular Expression Engine first matches the fat to the first letter "T", and fails, backtracing, and then obtains
CAT does not match, but does not succeed.
If none of them match, the system moves forward. Try the second letter, and so on until "belly" is used to match the word "belly". The match is successful.