Changes between Initial Version and Version 1 of Ticket #31819, comment 2


Ignore:
Timestamp:
Jul 23, 2020, 1:28:58 AM (4 years ago)
Author:
Perry Harrington

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31819, comment 2

    initial v1  
    44
    55\Z
    6 
    7     Matches only at the end of the string.
     6  Matches only at the end of the string.
    87
    98$
    10 
    119    Matches the end of the string or just before the newline at the end of the string, and in MULTILINE mode also matches before a newline. foo matches both ‘foo’ and ‘foobar’, while the regular expression foo$ matches only ‘foo’. More interestingly, searching for foo.$ in 'foo1\nfoo2\n' matches ‘foo2’ normally, but ‘foo1’ in MULTILINE mode; searching for a single $ in 'foo\n' will find two (empty) matches: one just before the newline, and one at the end of the string.
    12 
    1310
    1411Javascript:
    1512
    1613$       
    17 
    18 Matches the end of input. If the multiline flag is set to true, also matches immediately before a line break character. For example, /t$/ does not match the "t" in "eater", but does match it in "eat".
     14    Matches the end of input. If the multiline flag is set to true, also matches immediately before a line break character. For example, /t$/ does not match the "t" in "eater", but does match it in "eat".
    1915
    2016PHP:
    2117
    22  \Z
    23     end of subject or newline at end (independent of multiline mode)
     18\Z
     19  end of subject or newline at end (independent of multiline mode)
    2420
    25  A dollar character ($) is an assertion which is TRUE only if the current matching point is at the end of the subject string, or immediately before a newline character that is the last character in the string (by default). Dollar ($) need not be the last character of the pattern if a number of alternatives are involved, but it should be the last item in any branch in which it appears. Dollar has no special meaning in a character class.
    26 
    27 The meaning of dollar can be changed so that it matches only at the very end of the string, by setting the PCRE_DOLLAR_ENDONLY option at compile or matching time. This does not affect the \Z assertion.
     21$
     22  A dollar character ($) is an assertion which is TRUE only if the current matching point is at the end of the subject string, or immediately before a newline character that is the last character in the string (by default). Dollar ($) need not be the last character of the pattern if a number of alternatives are involved, but it should be the last item in any branch in which it appears. Dollar has no special meaning in a character class.
     23  The meaning of dollar can be changed so that it matches only at the very end of the string, by setting the PCRE_DOLLAR_ENDONLY option at compile or matching time. This does not affect the \Z assertion.
Back to Top