Another option is to use the template negation operator, '!', For the string "everything else" if your matching parameters are binary:
/^#.*/ { // Action for lines starting with '#' } !/^#.*/ { // Action for other lines }
Of course, your second template can also just match anything that doesn't start with a hash, i.e. /^►^#--------.*/
But presumably your example is simplification. For complex regular expressions, exact backward matching may not be possible. The negation operator simply makes it explicit and reliable.
And, as you already know, the ". *" Part is not needed.
source share