regex - Find multiple ocurrences of the same character using REGEXP_LIKE in oracle -


i have following situation: have email databases of people want receive promotional emails company, stuff flash sales, new product advertisement , etc. time now, people have been registering bogus email addresses aaa@aaa.aa. i'm working on way cleanse table , main issue far has been finding correct regexp_like pattern me.

i've tried where regexp_like (email_address, '(\w){3,}') that's no good. found emails john@doe.com. i've tried searching way in oracle far no good.

can assist me ?

you can try 1 of following patterns:

'(\w)\1{2,}' '((\w)+)\1+' 

the first pattern detect sequences of 3 or more of same character. example aaa or bbb. second pattern detect sequences of 2 or more repeating patterns of characters, such aa, bbb, abab, or 123123, etc.

this works using \1 reference 1st pattern surrounded parenthesis. in first pattern reference refers pattern of 1 character. in second pattern, reference refers batter of 1 or more characters.