Skip to content

cnhz95/regex-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Regex-like parser

Recursive-descent parser implementing the following EBNF grammar:

<match> := <expr>
<expr> := <subexpr> [<expr>]
<subexpr> := <group> | <or> | <count> | <word>
<group> := '(' <expr> ')'
<or> := <word> '+' <word>
<word> := <simple> [<word>]
<simple> := <count> | <greedy> | <char>
<count> := <char> '{' <digit> '}' | <any> '{' <digit> '}'
<greedy> := <char> '*' | <any> '*'
<char> := [A-Za-z]
<digit> := [0-9]
<any> := '.'

Usage

Run from the terminal using, for example, the command ./regex-parser "lo* could.{3}" < input.txt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published