Ign*_*ams 11
In single-line mode, $ matches either the end of the string, or just before the newline at the end of the string. In multiline mode $ matches before each newline in the string. \Z always matches only the end of the string regardless of the line mode. Same with ^ versus \A.
\ A和\ Z就像"^"和"$",除了它们在使用/ m修饰符时不会多次匹配,而"^"和"$"将在每个内部行边界匹配.要匹配字符串的实际结尾而不忽略可选的尾随换行符,请使用\ z.