clone_subpattern
6 from sre_parse import State as Pattern
7
8
9def clone_subpattern(subpattern, data=None):10 if not data:
11 data = subpattern.data
12 try:
create_subpattern
16 return SubPattern(state, data)
17
18
19def create_subpattern(seq=None):20 state = Pattern()
21 return SubPattern(state, seq)
simplify_regex
4from ._simplify import _simplify_sre_list
5
6
7def simplify_regex(pattern): 8 if not isinstance(pattern, SubPattern):
9 pattern = parse(pattern)
10 seq = _simplify_sre_list(pattern.data)
split_regex
3from .utils import create_subpattern
4
5
6def split_regex(pattern, at, remainer=False): 7 if not isinstance(pattern, sre_parse.SubPattern):
8 pattern = sre_parse.parse(pattern)
9 found = False
_simplify_sre_list
12from .utils import create_subpattern
13
14
15def _simplify_sre_list(seq): 16 new = []
17
18 prev_tok = None
The module/function docstring is missing.
If you want to ignore this, you can configure this in the .deepsource.toml
file. Please refer to docs for available options.