This project is an implementation of a clone of the UNIX egrep command as part of the Master 2 - STL course DAAR at Sorbonne Université by Amine Benslimane and Walid Sadat.
October 2021, Sorbonne Université.
For finite RegEx, we use the KMP Algorithm
For non-finite RegEx, we use the Aho-Ullman Algorithm
To run the command, run the runEgrep.sh shell script passing a regular expression and a valid file name as arguments :
sh runEgrep.sh RegEx FileName
Or by using bash command :
bash runEgrep.sh RegEx FileName
Or by setting permission on the script using chmod command :
chmod +x runEgrep.sh
./runEgrep RegEx FileName
For RegEx = al
in a french dictionary , we obtain :
For RegEx = S(a|g|r)*on
in A History of Babylon, From the Foundation of the Monarchy to the Persian Conquest History of Babylonia vol. 2 , we obtain :
Our Algorithm on the left, the egrep command on the right
We can see the accuracy of our algorithm in cloning the behavior of the egrep command.
See our document for more information