Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ func (s *Statement) Reconcile() (float64, bool) {

var findStatements = regexp.MustCompile(`(?m)^([0-9]{0,2})/([0-9]{0,2}) (.*) ([0-9\-\.,]+)`)

var findEnd = regexp.MustCompile(`Amount Rewards`)

var (
findPreviousBalance = regexp.MustCompile(`(?m)^Previous Balance \$([0-9\-\.,]+)`)
findNewBalance = regexp.MustCompile(`(?m)^New Balance \$([0-9\-\.,]+)`)
Expand All @@ -117,7 +119,11 @@ func main() {
yearBytes = yb[1]
}

sts := findStatements.FindAllSubmatch(body, -1)
end := len(body)
if loc := findEnd.FindIndex(body); loc != nil {
end = loc[0]
}
sts := findStatements.FindAllSubmatch(body[0:end], -1)
log.Printf("Found %d matches\n", len(sts))
for i, st := range sts {
if len(st) < 4 {
Expand Down