New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove regex dependency #2663
remove regex dependency #2663
Changes from all commits
d329dfe
458c874
39cbb57
487fac6
bdb41eb
9c4aaaf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
from abc import ABC, abstractmethod | ||
from collections import defaultdict | ||
from dataclasses import dataclass | ||
import regex as re # We need recursive patterns here (?R) | ||
import re | ||
from typing import ( | ||
Any, | ||
Callable, | ||
|
@@ -453,7 +453,7 @@ def make_naked(string: str, string_prefix: str) -> str: | |
# with 'f'... | ||
if "f" in prefix and "f" not in next_prefix: | ||
# Then we must escape any braces contained in this substring. | ||
SS = re.subf(r"(\{|\})", "{1}{1}", SS) | ||
SS = re.sub(r"(\{|\})", r"\1\1", SS) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will never have unicode to match right so we should be safe ... :D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I can tell the missing unicode support is just about character classes, so some "word" characters don't match |
||
|
||
NSS = make_naked(SS, next_prefix) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So nice.