ChefDK 227 fix for master

Cherry picks the 11-stable fix and adds some extra test cases to ensure regex correctness.

@opscode/client-engineers