diff options
| author | Grant Ammons <gammons@gmail.com> | 2016-05-05 15:38:39 -0400 |
|---|---|---|
| committer | Grant Ammons <gammons@gmail.com> | 2016-05-05 15:38:39 -0400 |
| commit | 8e77e4e86bbcffc1ca30b25ba26b0225a578df90 (patch) | |
| tree | abb770219646fb62db33fb74fabde9d4a642c349 | |
| parent | 89d111b7f0a05331ce87cc373108a164af23109e (diff) | |
Strip out a or add
| -rw-r--r-- | todolist/parser.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/todolist/parser.go b/todolist/parser.go index 59a290a..f78ce38 100644 --- a/todolist/parser.go +++ b/todolist/parser.go @@ -23,6 +23,8 @@ func (p *Parser) ParseNewTodo(input string) *Todo { } func (p *Parser) Subject(input string) string { + r, _ := regexp.Compile(`^(add|a) `) + input = r.ReplaceAllString(input, "") if strings.Contains(input, " due") { index := strings.LastIndex(input, " due") return input[0:index] |
