Improve RegEx validation code and fix bug with source port

The template was incorrectly emitting the --dport(s) arguments for the source port variable.
I also improved the regular expressions to allow for port ranges and hypens in the chain name.