feat(regexp_search): port and modify from RegExp.prototype.search