regular expression 4 assertions
by webproger on 2020-03-22
<JavaScript>
^     Matches beginning of input. If the multiline flag is set to true, also matches immediately after a line break character.
$     Matches end of input. If the multiline flag is set to true, also matches immediately before a line break character.
\b    Matches a word boundary, such as a space.
\B    Matches a non-word boundary. For example, /\w\Bn/ matches 'on' in "noonday", and /y\B\w/ matches 'ye' in "possibly yesterday."

<PHP PCRE>
^     In the default matching mode, the circumflex character is an assertion which is true only if the current matching point is at the start of the subject string.
$     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).
\A    start of subject (independent of multiline mode)
\Z    end of subject or newline at end (independent of multiline mode)
\z    end of subject (independent of multiline mode)
\b    word boundary
\B    not a word boundary

* These assertions have no special meaning in a character class.