AnchorsAnchors in regex are used to match the start and end of a string. They are used to match the start and end of a string.