Problem when combining Regex


I’m currently making a skill which sets an appliance to X degrees for Y minutes.
I have a regex file for temperature and one for the duration.

The skill is working fine if you just enter the input parameters, but that’ not how a “real” user would interact with the skill.

I also tested more common phrases (e.g. "set appliance to 30 degrees for 15 minutes), which only works in certain cases.

“Set appliance to 30 degrees for 15 minutes” - only sets the temperature parameter in my attributes.
“Set appliance to 30 degrees to 15 minutes” - sets both parameters in my attributes.

I use the following regex:
(?P<SET_TEMPERATURE>([3-9][0-9]|[0-2][0-9][0-9]) (degrees))(.*)
(?P<SET_TIME_MINUTES>([0-9]|[1-9][0-9]|[1-3][0-5][0-9]) (minutes))(.*)

After I tried different version of possible user inputs, I also tested it on a regex-tester, and the phrase above, which only returned the temperature works fine:

I was wondering what I have to change to get all these phrases working properly…