Python Insert Variable Into Regex Tester Javascript Array Slice