Skip to content

nnk03/grep-like-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grep-like-tool

The problem statement is given here

Input Format

<number-of-test-cases>
<reg-ex-1>
<test-string-1>
.
.
.

Regular Expression Input follows the below grammar

R -> concat(R, R)
R -> union(R, R)
R -> star(R)
R -> symbol(C)
C -> <any-ascii-character>

For example, if (a + b)^*c is the regular expression, the input format will be

concat(star(symbol(a)),union(symbol(b),symbol(c)))

To test it, specify the input in a test file, say input.txt

and run it with

cargo run < input.txt

If the string is part of the regular expression, output will be "Yes" Else the output will be "No"

It has been tested with the sample input file given here

About

A simple tool to check if a string belongs to a regular expression

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages