0

the match to find email has wrong regex expression, leading to missing emails that should have been otherwise populated in the output.

Below is the query

case when regexp_like(email,'^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$')

The above regex expression doesn't match emails like BILL@AMERITRUST-MORTGAGE.COM Instead it returns null when such emails are encountered.

mkul
  • 773
  • 1
  • 10
  • 28

1 Answers1

1

I used this statement and it worked:

select 1
  from dual
 where regexp_like('BILL@AMERITRUST-MORTGAGE.COM', '^([a-zA-Z0-9_\.-]+)@([a-zA-Z0-9_\.-]+)\.([a-zA-Z]{2,5})$');

The minus character must be the last one in the [...].

Kapitany
  • 1,319
  • 1
  • 6
  • 10