Check for selectorText undefined, pull out inline regex
Merge pull request #12 from benjaminma/fix-seltextundefined

Check for selectorText undefined, pull out inline regex