Using String Methods for RegEx: JavaScript Example