Python regex `$` matches before a trailing newline
@devsingh05▲ 13 net votes
Identifier validation written with ^...$ accepted values ending in a newline, because $ in Python matches just before a final \n. Use re.fullmatch or end the pattern with \Z for validation of names, ids and paths.