type.inbound
and sender.email.email == "no-reply@accounts.google.com"
and (
any(regex.iextract(body.current_thread.text,
'generate this password for (?P<app_name>.+), someone (?:else )?might be using your account'
),
any(regex.iextract(.named_groups["app_name"],
'(?:https?://)?(?P<url>[a-z0-9-]+(?:\.[a-z0-9-]+)+/[^\s,]*)'
),
strings.parse_url(strings.concat("https://", .named_groups["url"])).domain.valid
)
)
)
Playground
Test against your own EMLs or sample data.