# NX-OS ACL structure is quite complex and includes IP, IPv6 and MAC ACL types.
# 
# IP/IPv6 ACL:
# 	SEQUENCE_NUMBER ACTION PROTOCOL SOURCE [PORT id] [RANGE start finish] DESTINATION [MODIFIER]
#
# MAC ACL:
#	SEQUENCE_NUMBER ACTION SOURCE DESTINATION [MODIFIER]
#	 
Value Filldown NAME (.*)
Value Required SN (\d+)
Value ACTION (\w+)
Value PROTOCOL ([^any][\w+\d+]+)
# SOURCE RegEx must be able to catch both MAC and IP addresses including masks. 'any' and 'address group' are possible too. 
Value SOURCE ([\w+\d+]+\.[\w+\d+]+\.[\w+\d+]+\s[\w+\d+]+\.[\w+\d+]+\.[\w+\d+]+|any|\d+\.\d+\.\d+\.\d+/\d+|addrgroup\s\S+|\S+)
# RANGE RegEx catches the first and last protocol to match in the interval range.
Value RANGE (\S+\s\S+)
# We can specify protocols to match. 'eq', 'gt', 'lt' and 'neq' are supported.
Value PORT (eq\s\S+|gt\s\S+|lt\s\S+|neq\s\S+)
# SOURCE RegEx must be able to catch both MAC and IP addresses including masks. 'any' and 'address group' are possible too.
Value DESTINATION ([\w+\d+]+\.[\w+\d+]+\.[\w+\d+]+\s[\w+\d+]+\.[\w+\d+]+\.[\w+\d+]+|any|\d+\.\d+\.\d+\.\d+/\d+|addrgroup\s\S+|\S+)
# What it remains is some ACL modifier used to do fancy stuff. 
Value MODIFIER (.*)

Start
  # ACL name is catched. This is a FILLDOWN value, so everyother line without a NAME would inherits the last value matched.
  ^.*list\s+${NAME} 
  # This line matches all the possible combination of fields specifed above.
  ^\s+${SN}\s+${ACTION}(\s+${PROTOCOL})*\s+${SOURCE}(\s+${PORT})*(\s+range\s${RANGE})*\s+${DESTINATION}(\s+${MODIFIER})* -> Record

