scrapinghub / slackbot

A chat bot for Slack (https://slack.com).
MIT License
1.26k stars 394 forks source link

Regex group support #118

Open tribela opened 7 years ago

tribela commented 7 years ago

respond_to and listen_to are receiving regex pattern as it's argument like hello (.+?). But I want to name some group to an argument. eg.

@respond_to(r'run code (\"|\')(?P<code>.+?)\1(?: (\"|\')(?P<argument>)\3)?')
def run_code(message, code, argument=None):
    pass

It can be very useful. If you like to, I can make PR for it.

lins05 commented 7 years ago

@Kjwon15 sorry for the late reply. It seems handy if we support this. Do you still want to work on it?

tribela commented 7 years ago

Yes, I can handle this. I'll open PR when ready.