1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Change slightly the diario regex

This commit is contained in:
Steffo 2019-08-31 11:29:49 +02:00
parent 1f4882b9f7
commit 6edb7e3f86

View file

@ -108,7 +108,7 @@ class DiarioCommand(Command):
if raw_text: if raw_text:
# Pass the sentence through the diario regex # Pass the sentence through the diario regex
match = re.match( match = re.match(
r'(!)? *["«‘“‛‟❛❝〝"`]([^"]+)["»’”❜❞〞"`] *(?:(?:-{1,2}|—) *([\w ]+))?(?:, *([^ ].*))?', r'(!)? *["«‘“‛‟❛❝〝"`]([^"]+)["»’”❜❞〞"`] *(?:(?:-{1,2}|—) *([^,]+))?(?:, *([^ ].*))?',
raw_text) raw_text)
# Find the corresponding matches # Find the corresponding matches
if match is not None: if match is not None:
@ -162,7 +162,7 @@ class DiarioCommand(Command):
# Recreate the full sentence # Recreate the full sentence
raw_text = " ".join(args) raw_text = " ".join(args)
# Pass the sentence through the diario regex # Pass the sentence through the diario regex
match = re.match(r'(!)? *["«‘“‛‟❛❝〝"`]([^"]+)["»’”❜❞〞"`] *(?:(?:-{1,2}|—) *([\w ]+))?(?:, *([^ ].*))?', match = re.match(r'(!)? *["«‘“‛‟❛❝〝"`]([^"]+)["»’”❜❞〞"`] *(?:(?:-{1,2}|—) *([^,]+))?(?:, *([^ ].*))?',
raw_text) raw_text)
# Find the corresponding matches # Find the corresponding matches
if match is not None: if match is not None: