Question: My current RegEx for phone number validation is `^\d{8,}$` which validates minimum length is 8 and does not allow special characters or letters and my question is what's the RegEx which does not allow 9-15 consecutive duplicate numbers plus the current condition (minimum length is 8 and no special characters or letters allowed).

Thanks...

Answer: 
To understand the regex in a better way

NODE EXPLANATION

```
  ^                        the beginning of the string
   (?!                      look ahead to see if there is not:
    .*                       any character except \n (0 or more times
                         (matching the most amount possible))
     (                        group and capture to \1:
      \d                       digits (0-9)
     )                        end of \1
    \1{8}                    what was matched by capture \1 (8 times)
   )                        end of look-ahead
  \d{8,}                   digits (0-9) (at least 8 times (matching
                       the most amount possible))
 $                        before an optional \n, and the end of the
                       string

```
So `11111111` (8 `1`s) is ok, but `111111111` (9 `1`s) isn't?

A regex isn't *always* the right answer. I'd keep the existing `^\d{8,}$` regex and then check for repeated digits separately. Since you're only (for now?) forbidding 10 distinct numbers, you could just set up a hash of forbidden numbers and check against it:

```
my %forbidden = map { $_ x 9 => 1 } 0..9;

...

if ($num =~ /^\d{8,}$/ and not $forbidden{$num}) {
    # accept
}
else {
    # reject
}

```