Adilius/regex-parser

Regular expression parser written in C++ for school project

★ 2Forks 0C++GitHub ↗Compare
cpp

README

Regular Expression Parser

Regular expression parser written in C++ for school project

Grammar

<RE> ::= <simple-RE>
<simple-RE>	::=  concatenation> | <basic-RE> 
<concatenation> ::= <basic-RE> <simple-RE> 
<basic-RE>	::= <star> | <plus> | <count> | <elementary-RE>
<star>	::=	<elementary-RE> "*"
<count> ::= <elementary-Re>  "{" any number "}"
<elementary-RE>	::=	 <character> | <group> | <any> 
<group>	::=	"(" <RE> ")"
<any>	::=	"."
<character>	::= any non metacharacter

Build

Either build by running the regex-parser.sln file containing the Visual Studio 2019 project file. Or build it with a C++ compiler and including all the headers and main.cpp file.

Run

Run regex-parser from terminal. .\regex-parser.exe "Waterloo" input.txt First argument is the regex. Second argument is the file containing the text

Output

output1 output2 output3

Contributors

Adilius

Issues

Images

#1 · closed · 0 comments