This file contains hidden or 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
// Simulating infinite-length leading lookbehind in JavaScript. Uses XRegExp | |
// and XRegExp.matchRecursive. Any regex pattern can be used within lookbehind, | |
// including nested groups. Captures within lookbehind are not included in | |
// match results. Lazy repetition in lookbehind may lead to unexpected results. | |
(function (XRegExp) { | |
function preparePattern(pattern, flags) { | |
var lbOpen, lbEndPos, lbInner; | |
flags = flags || ""; |
NewerOlder