Anchor regex meta-rules.
This commit is contained in:
parent
75d67f9fdb
commit
ccd90668b9
2 changed files with 3 additions and 1 deletions
2
parse.go
2
parse.go
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue