Optional connector words in skill (regex)

Having trouble with getting mycroft to parse a skill that may or may not be using a connector word. I want to match both the following phrases

hey mycroft turn on the office lights
hey mycroft turn on office lights

I can match either one of these strings without issue, but I really want to make it flexible to respond either way. What is wrong with this regex?

turn (?P(on|off)) (?Pthe)* ?(?P\w+)

and this intent?

turn_off_intent = IntentBuilder(“TurnOffIntent”).require(“TurnOffKeyword”).require(‘Action’).optionally(‘Connector’).require(‘Light’).build()