Added support for start-of-input (\A) and end-of-input (\Z) assertions

This commit is contained in:
2025-01-30 13:56:56 -05:00
parent db7c884b83
commit ee51e39d59
3 changed files with 24 additions and 2 deletions

View File

@@ -878,6 +878,10 @@ func thompson(re []postfixNode) (Reg, error) {
stateToAdd.assert = wboundAssert
case 'B':
stateToAdd.assert = nonwboundAssert
case 'A':
stateToAdd.assert = soiAssert
case 'Z':
stateToAdd.assert = eoiAssert
}
} else { // Lookaround
stateToAdd.lookaroundRegex = string(c.contents)