Skip to content

Instantly share code, notes, and snippets.

@abozhilov
Created August 22, 2011 09:09
Show Gist options
  • Save abozhilov/1161984 to your computer and use it in GitHub Desktop.
Save abozhilov/1161984 to your computer and use it in GitHub Desktop.
RegExp.prototype.match
/**
* Applying regex on substring
* http://qfox.nl/weblog/237
*/
RegExp.prototype.match = function (str, start) {
if (start > 0) {
return this.exec(str.slice(start));
}
return this.exec(str);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment