Matches texts with regular expressions. Similar to re.search() in python.
- Takes text and a regular expression as input
- If matched, returns
<1, start_index, end_index>
- If not matched, returns
<0>
gcc re_engine.c -o re_engine
Example of an input file is given below:
Hello there. This is a sample text for the input. abcd9
12
the
abc[a-z][0-9]
9+a+
.*e.*e
.*
.*?
\w+e.*e
\w+e\w*e
\w*s.*\d
[a-zA-zBBCD9]*?\w*x.*\d
3?\d?
Hello.*is\w*?
./re_engine < input_files/sample_inp