A ^…$ regex accepts one trailing newline in PHP and Python — the strict anchors are /D, \z and re.fullmatch
Without /m, a ^…$ regex accepts a value ending in a newline, in PHP preg_match and Python re alike. Strict forms: the D modifier, \z, re.fullmatch.
