Check both beginning-of-text conditions in Regexp
This commit is contained in:
@ -41,7 +41,7 @@ func (rr *RuneReader) Cursor() cursor.Cursor[byte] {
|
||||
}
|
||||
|
||||
func Regexp(str string) gigaparsec.Parser[byte, []byte] {
|
||||
if !strings.HasPrefix(str, "^") {
|
||||
if !strings.HasPrefix(str, "^") && !strings.HasPrefix(str, `\A`) {
|
||||
str = "^" + str
|
||||
}
|
||||
re := regexp.MustCompile(str)
|
||||
|
Reference in New Issue
Block a user