refactored chapter7 - created package regex