https://github.com/maskray/regex
A little regex engine
https://github.com/maskray/regex
Last synced: 7 months ago
JSON representation
A little regex engine
- Host: GitHub
- URL: https://github.com/maskray/regex
- Owner: MaskRay
- Created: 2012-11-05T06:25:35.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-11-05T06:56:16.000Z (over 13 years ago)
- Last Synced: 2025-03-26T18:21:31.366Z (12 months ago)
- Language: C
- Size: 109 KB
- Stars: 18
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Regex
A parody of http://code.google.com/p/re1/ with the intention to provide a
simple, concise and constructive regex engine implementation.
The parser part is a proof-of-concept design employing Shunting-yard algorithm
to illustrate to feasibility to process unary operators and surrounds like
parentheses.
# Syntax
a? match 1 or 0 times
a* match 0 or more times
a+ match 1 or more times
a?? match 1 or 0 times, not greedily
a*? match 0 or more, not greedily
a+? match 1 or more, not greedily
. match any character
| alternative
(a) capturing parentheses
# Build
make
# Usage
./main '(ray|yar)' 'hello, ray'