revised testing for regex