Fixed exec issue with RegExp