Updated Python script regex