Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

Regex to match any character being repeated more than 10 times

#!perl
use warnings;
use strict;
my $regex = qr/(.)1{9,}/;
print "NO" if "abcdefghijklmno" =~ $regex;
print "YES" if "------------------------" =~ $regex;
print "YES" if "========================" =~ $regex;

#Although the above test script is in Perl, 
#this is very standard regex syntax and should work in any language. 
#In some variants you might need to use more backslashes, 
#e.g. Emacs would make you write (.)1{9,} here.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Regex #match #character #repeated #times
ADD COMMENT
Topic
Name
3+6 =