Skip to content

angajime/pylex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pylex

Fast and simple regex matcher.

Why

I made this fast and usefull script for my language processors class.

How-to

> python pylex.py input.in

input.in

This must be a file containing a list of regexs and a list of test, formatted like this:

^0[0-9]*
[0-9]*0$
%%
0
00
001
1
2
012
210

output

Output is standard console output:

^0[0-9]*             0           [PASS] 
^0[0-9]*             00          [PASS] 
^0[0-9]*             001         [PASS] 
^0[0-9]*             1           [FAIL] 
^0[0-9]*             2           [FAIL] 
^0[0-9]*             012         [PASS] 
^0[0-9]*             210         [FAIL] 
[0-9]*0$             0           [PASS] 
[0-9]*0$             00          [PASS] 
[0-9]*0$             001         [FAIL] 
[0-9]*0$             1           [FAIL] 
[0-9]*0$             2           [FAIL] 
[0-9]*0$             012         [FAIL] 
[0-9]*0$             210         [PASS] 

About

Fast and simple regex matcher.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages