moved the regex rules into regex.py