-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix random matches are missed + add test
Alternative implementation to #47
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ class TextExtraction { | |
); | ||
|
||
textLeft = textLeft.substr(matches.index + matches[0].length); | ||
indexOfMatchedString += matches[0].length; | ||
indexOfMatchedString += matches[0].length - 1; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sh-helen
|
||
// Global RegExps are stateful, this makes it operate on the "remainder" of the string | ||
pattern.pattern.lastIndex = indexOfMatchedString; | ||
} | ||
|
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
Hi, seems this doesn't fix the problem