Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Best way to find string composed of dup character?
"Dr Drudge" <drdrudge_at_hotmail.com> wrote in message
news:748419a0.0402250601.18e767f_at_posting.google.com...
> I need to be able to determine whether a varchar2 column contains a
> string of dup characters. Specifically, I need to weed out (or
> alternatively find) phone numbers like: 1111111, 9999999999, etc.
If you get a chance to use Oracle 10G, then it's becoming much, much easier
to do stuff like that.
In 10G you could do something like this :
where repexp_like(p1.phonenumber,'([[:digit:]])\1\1\1\1\1\1')
Isn't that much nicer ? ;-)
-- Kim Berg Hansen Chef-udvikler / Senior System Developer T. Hansen Gruppen A/S www.thansen.dkReceived on Thu Feb 26 2004 - 05:18:50 CST