added tests and changed regex