Seach for ordered matches to a set of regular expressions in an input
file, returning true if the matches occur in the correct order.
The ordered grep method will only return true if matches to the set of
regular expression in the expression list occur in the input file in the
order they appear in the expression list. Matches to the regular
expressions do not have to be across sequential lines in the input file,
only in the correct order. For example, for a file with contents :
A is for apple
B is for book
C is for cat
D is for dog
an expression list of ["^A.*$", "^C.*$",
"^D.*$"] will return true, whilst an expression list of
["^A.*$", "^C.$", "^B.$"] will return
false.
- Parameters:
file - The full path to the input file
exprList - A list of regular expressions (uncompiled) to search for in the
input file
- Returns: integer
- success (True / False)
- Raises:
|