2

This is what I got so far I'm getting some status to fail;

https://regex101.com/r/KuUS5L/1

[[:<:]]lms.com[[:>:]]

These are my expected status:

Keyword status
lms.com 1
live.lms.com 1
live-lms.com 0
cssslms.com 0
lmsccc.com 0
lms.com.ph 0
lms.com.edu 0
SELECT 
*
 FROM
(SELECT 
    SUBSTRING_INDEX(email, '@', - 1) AS substrEmail1,
    email
FROM
    members m1) AS d
 WHERE d.substrEmail1 regexp '[[:<:]]gs.com[[:>:]]';
woninana
  • 3,409
  • 9
  • 42
  • 66

1 Answers1

1

Here is my answer, provided also in the comments.

Either:

select * from test
where url REGEXP '^([[:alpha:]]+\\.lms|lms)\\.com$' = 1;

Or

select * from test
where url REGEXP '^([[:alpha:]]+\\.)?lms\\.com$' = 1

See it working here: http://sqlfiddle.com/#!9/a51de/2

Jorge Campos
  • 22,647
  • 7
  • 56
  • 87