The PCRE-compliant PCRE_DOLLAR_ENDONLY modifier that makes the
$ anchor match at the very end of the string (excluding the position before the final newline in the string).
is equal to
and matches a whole string that consists of 1 or more digits and will not match
"123\n", but will match
if you want to reproduce, please indicate the source:
Regex modifiers (flags) – PCRE_DOLLAR_ENDONLY modifier - CodeDay