Skip to content

Commit

Permalink
Merge pull request #126 from charmasaur/regex_speed
Browse files Browse the repository at this point in the history
Use a MULTILINE anchored regex when removing carriage returns
  • Loading branch information
takluyver authored Sep 26, 2019
2 parents 26555e5 + cf397be commit 232d249
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nbval/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ def sanitize(self, s):
return s


carriagereturn_pat = re.compile(r'.*\r(?=[^\n])')
carriagereturn_pat = re.compile(r'^.*\r(?=[^\n])', re.MULTILINE)
backspace_pat = re.compile(r'[^\n]\b')


Expand Down

0 comments on commit 232d249

Please sign in to comment.