Removed reliance on regular expressions