Skip to content

Commit

Permalink
Optimising regex with special char detection (UsergeTeam#454)
Browse files Browse the repository at this point in the history
I didn't checked the worst cases where it breaks but flags like -at=-100xxxxxxxxx works fine now without breaking previous detections
@rking32 maybe i need your review
  • Loading branch information
Harsh-br0 authored Jan 31, 2022
1 parent f2ee487 commit 191d85a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion userge/core/types/bound/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def _filter(self) -> None:

if input_str.startswith(prefix):
del_pre = bool(self._kwargs.get('del_pre', False))
pattern = re.compile(f"({prefix}[A-z]+)(\\d*|=\\w*)$")
pattern = re.compile(rf"({prefix}[A-z]+)(=?\S*)$")

end = False
parts = input_str.split(' ')
Expand Down

0 comments on commit 191d85a

Please sign in to comment.