The current script is already broken due to Bind 9.16 -> 9.18 changes due to their renaming scheme for primary/secondary so do not rely on the compat layer (which was also broken for other reasons).
Extended the regex to skip the new transferkey and hmac sections of opnsense bind.
Correction when having many zones.
Update for opnsense regards to error in #3735
CLOSES #2480