Maybe instead of matching anything between http(s):// and id.fedoraproject.org, only match for (|stg.|dev.)?
Also, the OpenID endpoint in Fedora Infrastructure always includes the trailing slash, so I would make that non-optional.