Hello,
I have a REGEXP question. Hope someone could help. I'm trying to match domain. I'm trying to get all the email with domains @mydomain.fr
The problem is that I also need to match
- @foo.mydomain.fr
- @bar.mydomain.fr
But not
email@zdomain.fr
I tried the following but it also matched the email@zdomain.fr.
WITH t AS
(
SELECT 'email@domain.fr' AS email FROM dual UNION ALL
SELECT 'email@foo.domain.fr' AS email FROM dual UNION ALL
SELECT 'email@bar.domain.fr' AS email FROM dual UNION ALL
SELECT 'email@zdomain.fr' AS email FROM dual
)
SELECT email, 1
FROM t
WHERE REGEXP_LIKE(email, '*(\.)?domain.fr', 'i') ;
I read my REGEXP like this: email starts with anything; followed by a dot (optional) and then domain.fr case insensitive. Isn't it right ??
Anyone can tell me what I'm doing wrong?
Thanks,