Amazing! So if I could write down my grammar accurately, bulk of the job is done. But for some reason it is not matching anything. Does it have to match all the tokens in order to have a successful match? I am suspicious of the grammar that I provided.
Any way here is the data you can test with (same as the one successfully used by CountZero for his test case):
access-list V420_IN extended permit object-group Symantec_Service_Grou +p 10.148.0.0 255.254.0.0 host 10.149.16.40 access-list V420_IN extended permit object-group Symantec_Service_Grou +p any any access-list V420_IN extended permit tcp any any range 137 139 access-list V420_IN extended permit tcp any any eq 445
I note that I didn't mention the possibility of 'any' for source & destination in my BNF grammar. It should be a simple addition though. But I wonder why even the first rule cannot be parsed. Here is the output with debug on
... and so on till the last line.===================> Trying <grammar> from position 0 access-list V420_IN |...Trying <acl> | \FAIL <acl> \FAIL <grammar> ===================> Trying <grammar> from position 1 ccess-list V420_IN e |...Trying <acl> | \FAIL <acl> \FAIL <grammar> ===================> Trying <grammar> from position 2 cess-list V420_IN ex |...Trying <acl> | \FAIL <acl>
In reply to Re^4: Regex to match a Cisco ACL
by Anonymous Monk
in thread Regex to match a Cisco ACL
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |