RegEx: Repeated identical vowels in a string - Oracle SQL -



RegEx: Repeated identical vowels in a string - Oracle SQL -

i need display strings (name of manufacturers) contain 2 or more identical vowels in oracle11g. using regex find this.

select manuf_name "manufacturer", regexp_like(manuf_name,'([aeiou])\2') counter manufacturer;

for example: regex accepts

otterbox abca abca

the regex rejects

samsung apple

i not sure how proceed ahead.

i think want this:

with mydata ( select 'otterbox' manuf_name dual union select 'apple' dual union select 'samsung' dual ) select * mydata regexp_like(manuf_name, '([aeiou]).*\1', 'i');

i not sure why used \2 backreference instead of \1 -- \2 doesn't refer in regex. also, note wildcard , quantifier .* indicate there can number of character between first occurrence of vowel , second. third, note 'i' parameter indicate case-insensitive search (which think want since regex should match "otterbox").

sql fiddle here.

sql regex oracle

Comments

Popular posts from this blog

Using Android Volley to post an array to PHP -

python - How to add an model instance to a django queryset? -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -