Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 1.16 KB

README.md

File metadata and controls

35 lines (27 loc) · 1.16 KB

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