-
^ is said to match one The beginning of the line , but it is correct after"\ n" ,"\ r" or"\ r \ n" Does not match. It matches the beginning of a string, though. In what sense it matches the beginning of a line, and how it is different from\ A$ It is said that the end of a line , but it is"\ 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 ? Unlike\ z ,\ z ,"\ n" mail before If the account is at the end of the string, it seems that\ A and\ z are naturally occurring concepts, and\ z Why is it that weird one is that\ z and\ z are defined, and not on the other side? And, you want to use\ z ?Can you illustrate using the examples above? If there is a difference in languages / standards, then it will be helpful to list them.
The difference is that
^ and$ Changes in anchors can be behavior. Withmultiline mode,^ and$ anchors emphasize the beginning and ending of a line.Together with
mode, ^ and$ emphasize the beginning and closing of the anchor string.
Most regex implementations have a
multiline mode.With Ruby, Perl, or Javascript, it is defined with the
m modifier like/ pattern / mWith the .net, do it within
(? M) pattern, orRegexOptions.Multiline counting.
To answer your third question ...
\ A - The match must be match at the beginning of the string.\ z - The end of the string or the end of the string should match before\ n .\ z - The string should end in match.These three are stable which are not affected by any modifier. I believe that
\ A and\ z seem to be an inappropriate coupler, it does not make much sense to me, but in a case where you can has the previous line feed that you want to ignore, then\ z can be preferred.
Comments
Post a Comment