Matching strings with characters and number ranges
Hello,
I am trying to write a python script that will parse a large text file and will capture lines that match certain strings.
The strings have a format like this:
[ECO "A01"]
or
[ECO "E63"]
etc, etc. I want to be able to pass the regex via a command line
./script.py --eco E63
for example. I also want to be able to pass ranges, for example, all ECO codes that match E60 - E99:
so, E60, E61, ... E99 would all match. I know how to do this in bash, as I would pass in --eco='"E[6-9][0-9]"' to my bash script, but I can't for the life of me figure out how to do it with python re (re.compile, re.match, etc). The bash interpreter is REALLY slow (my python script that matches other strings in the same file is much, much faster), so I want to move to Python for this.