https://github.com/superb-man/regex-parser
Simple regex matcher with some advanced operations.Can only parse a regex😔 and match some elementary operations🚀.Nothing fancy!
https://github.com/superb-man/regex-parser
parser
Last synced: 7 months ago
JSON representation
Simple regex matcher with some advanced operations.Can only parse a regex😔 and match some elementary operations🚀.Nothing fancy!
- Host: GitHub
- URL: https://github.com/superb-man/regex-parser
- Owner: Superb-Man
- Created: 2024-08-20T14:26:10.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-22T06:52:05.000Z (9 months ago)
- Last Synced: 2025-01-22T07:35:31.716Z (9 months ago)
- Topics: parser
- Language: C++
- Homepage:
- Size: 63.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Regex-Parser
# Why did I try to implement it ?
To understand about parser/syntax tree```
The AstNode is not necessarily needed for validating regex only.
Not all possible operations implementedDrawback - so many sequential nodes!
Future hope - Will try to implement the RegexMatcher later
```
# Description
Extended work of Automaton- solver.Implemented a very basic regular expression parser. Although it doesn't support all the operations possible.Was motivated by regex matcher at linux system.Implementing full library by own is quite a complex task.Yet i gave a try and still i am working to improve.
# Limitations
```
- Limitaions with multiple OR operations!
- Doesn't support all
```
# The subset of regex it worked!
"a.?b",
"a+b*(c+de)*f",
"a*b+c?(d+)?",
"a[a-zA-Z0-9.]",
"a*b+c?d*?xyz+",
"a(.6)*d",
"a[0-9]62",
"acd*b",
cd "a?b",
"a[a-z]b",
"a(.bc|c*)+",
"a([a-z].)*",
"a(.s|a)*62",
"[a-z]*b",
"a(.sb)*bc*",
"cd[a-z]|a(.bc)*b*",
"ad|(b|.c)*",
"a.?b",
"a(a|bc)*(bd|b)",
"aaab",
"b|bd", /////////////////////////////DON'T WORK
"a*(b|(cd+|e*f))bd",
"([0-9]|a*(b|(cd+|e*f)))bd",
"a.*b",
"a((.)*)bcd+(((c)d)e)",
"a.*b[0-9]+b+b*",
"a*a+",
"a.*b*cd+.*f",
"a(.bc)*d",
"a*b*.*g*.+",
"abcd+.*f",
"ab*b?c+.*f",
"a?ab",
"a*",
"a*[dzf]*dfb*",
"[a-c]+z",
"a+",
".*a+[s-v0-5]*bcd+e(a|b)*", ///////////WORKING
".*a+.*bcd+e(a|b)*", //////////WORKING
"[a-c]+a[a-c]+",
".*a[a-c]+",
"abc[a-d]?.*abc",
"(ab*)*|b(c|d+)",
"a*|c*",
"(a|b)b",
"a.*[a-c]+d",
"a[a-c]+.*d",
"[a-c]+a*a+a",
".+ba",
"a(c|b)*abc"