Javascript Regex End Of String Variable Python