Skip to content

Commit 716dfa1

Browse files
committed
fix: use \A and \z for string delimiters
1 parent 334a000 commit 716dfa1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

parts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (pl partList) generateRegularExpressionAndNameList(options options) (string
6060
result.WriteString("(?i)")
6161
}
6262

63-
result.WriteByte('^')
63+
result.WriteString("\\A(?:")
6464

6565
for _, p := range pl {
6666
if p.pType == partFixedText {
@@ -165,7 +165,7 @@ func (pl partList) generateRegularExpressionAndNameList(options options) (string
165165
}
166166
}
167167

168-
result.WriteByte('$')
168+
result.WriteString(")\\z")
169169

170170
return result.String(), nameList, nil
171171
}

0 commit comments

Comments
 (0)