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
Post a Comment