Use Regex In If Statement Javascript Example