remove_email_plus_address(email)
any sub-address (also known as plus addressing) from an <email> address.
CREATE OR REPLACE FUNCTION `justfunctions.eu.remove_email_plus_address`(`email` STRING)
RETURNS STRING AS (REGEXP_REPLACE(email,r'(\+\w+)(@)', r'\2'))
OPTIONS ( description = ''' any sub-address (also known as plus addressing) from an <email> address.''')
Example
SELECT `justfunctions.eu.remove_email_plus_address`("hey+other@gmail.com")
hey@gmail.com