You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pattern = r"(?P<sender>[\w\s]+) said to (?P<recipient>[\w\s]+): [\"'](?P<message>.*)[\"']"
I've got messages which are addressed to "everyone in location", which breaks this regex, as it doesn't expect recipient to have whitespace in it. This causes the sender_name, recipient, content = re.findall(pattern, event.description)[0] to explode
Adding .* to the regex to allow the recipient to have spaces in it makes it work, though I'm not sure it wont break something else
With the .* added: pattern = r"(?P<sender>[\w\s]+) said to (?P<recipient>[\w\s]+.*): [\"'](?P<message>.*)[\"']"
The text was updated successfully, but these errors were encountered:
pattern = r"(?P<sender>[\w\s]+) said to (?P<recipient>[\w\s]+): [\"'](?P<message>.*)[\"']"
I've got messages which are addressed to "everyone in location", which breaks this regex, as it doesn't expect recipient to have whitespace in it. This causes the
sender_name, recipient, content = re.findall(pattern, event.description)[0]
to explodeAdding
.*
to the regex to allow the recipient to have spaces in it makes it work, though I'm not sure it wont break something elseWith the
.*
added:pattern = r"(?P<sender>[\w\s]+) said to (?P<recipient>[\w\s]+.*): [\"'](?P<message>.*)[\"']"
The text was updated successfully, but these errors were encountered: