Does this regex mean it has to start with A, end with Z?
re.search("\A[0-9A-Za-z_-]+\Z", sometext)
No, those are anchors.
\A
means start of string, and \Z
means end of string. Similarly ^
means start of line and $
means end of line.
See the documentation for the re module.
\A - Matches only at the start of the string.
\Z - Matches only at the end of the string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With