Merge pull request #107 from mccoyst/pick-a-choose

I had parsing on the brain, I swear
This commit is contained in:
Chris Sexton 2018-08-30 14:16:43 -04:00 committed by GitHub
commit 5f0b0fc3c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -57,8 +57,8 @@ func (p *PickerPlugin) Message(message msg.Message) bool {
return true
}
var pickerListPrologue = regexp.MustParse(`^pick[ \t]+([0-9]*)[ \t]+\{[ \t]+`)
var pickerListItem = regexp.MustParse(`^([^,]+),[ \t]+`)
var pickerListPrologue = regexp.MustCompile(`^pick[ \t]+([0-9]*)[ \t]+\{[ \t]+`)
var pickerListItem = regexp.MustCompile(`^([^,]+),[ \t]+`)
func (p * PickerPlugin) parse(body string) (int, []string, error) {
subs := pickerListPrologue.FindStringSubmatch(body)