Regular Expressions Regex modifiers (flags) PCRE_DOLLAR_ENDONLY modifier


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 "123".