This is a small regular expression program which could parse and match simple regular expression.
The idea of NFA is learned from [1]. The implementation mainly refer to Russ Cox's Regular expression matching can be simple and fast.
The program could matching plain text including all English alphabets and Arabic numerals
The parenthesis could only be used to specify the priority. No capture is implemented.
The program support quantity characters including *
, ?
and +
and
alternation character |
.
[1] Thompson K. Programming Techniques: Regular expression search algorithm[J]. Comm Acm, 1968, 11(6):419-422.