1_1 and 1_3: Both simply use the regex to identify the pattern. The rule .* is used in case it matches a substring and not the whole expression.
2_2: Simple tokenizer
3: Enhancement of 2_2. The last rule ignores brackets, braces, semicolons and spaces.