changed regex for "safe" expressions
added a few TODOs