Skip to content
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

Agent to agent messages can be addressed X in Y #89

Open
marvinirwin opened this issue Jul 23, 2023 · 0 comments
Open

Agent to agent messages can be addressed X in Y #89

marvinirwin opened this issue Jul 23, 2023 · 0 comments

Comments

@marvinirwin
Copy link

marvinirwin commented Jul 23, 2023

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>.*)[\"']"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant