Anchor regex meta-rules.

This commit is contained in:
Daniel Jones 2014-02-01 19:13:27 -08:00
parent 75d67f9fdb
commit ccd90668b9
2 changed files with 3 additions and 1 deletions

View file

@ -308,7 +308,7 @@ func parseRecipe(p *parser, t token) parserStateFun {
r.targets = append(r.targets, pattern{spat: targetstr})
if r.attributes.regex {
rpat, err := regexp.Compile(targetstr)
rpat, err := regexp.Compile("^" + targetstr + "$")
if err != nil {
msg := fmt.Sprintf("invalid regular expression: %q", err)
p.basicErrorAtToken(msg, p.tokenbuf[k])