inventory of regex anchors
问题 ^ is said to match the beginning of a line , but it does not match right after a "\n" , "\r" or "\r\n" . It matches the beginning of a string, though. In what sense does it match the beginning of a line, and how is it different from \A ? $ is said to match the end of a line , but it does not match right before a "\n" , "\r" or "\r\n" . It matches the end of a string, though. In what sense does it match the end of a line, and how is it different from \z ? \Z , unlike \z , matches right before