package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)<[A-Z][A-Za-z:]*[^>]* ((?!class)[^ @]*)=[^>]*`)
var str = `<LinkTo @route="foo.bar" @model={{this.model}} class="fancy-link">
foo
</LinkTo>
<Input @checked={{this.isChecked}} @type="checkbox" class="fancy-checkbox" />
<Foobar class="fancy-foobar" myArgument={{false}} as |foobar|>
<Foo @customerId={{this.model.id}} page={{50}} />
<Foobar class="fancy-foobar" myArgument={{false}} />
</Foobar>`
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/