package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`failing[\w\W]*?\d*\)\s[\w\W]*?\:[\s\S]*?(Assert[\w\W]*?)[\n].*(src[^:]+):(\d+):(\d+)`)
var str = ` 1) validates input
0 passing (660ms)
1 failing
1) statement:propose validates input:
AssertionError: expected { Object (status, err) } to have a deep property 'err' of 'err1', but got 'Error while fetching the changes from the event store: {}'
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:307:16)
at .<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:21)
at ctx.(anonymous function) [as property]
at src/aggregate/index.js:144:100
(node_modules/chai/lib/chai/utils/overwriteMethod.js:49:33)
at Context.<anonymous> (src/aggregate/test/index.js:44:36)
`
for i, match := range re.FindAllString(str, -1) {
fmt.Println(match, "found at index", i)
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/