Created
August 22, 2011 09:09
-
-
Save abozhilov/1161984 to your computer and use it in GitHub Desktop.
RegExp.prototype.match
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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