Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =================================================
- #!perl
- use warnings;
- use strict;
- my $regex = qr/(.)1{9,}/;
- print "NO" if "abcdefghijklmno" =~ $regex;
- print "YES" if "------------------------" =~ $regex;
- print "YES" if "========================" =~ $regex;
- txt = """1. aaaaaaaaaaaaaaa
- 2. bb
- 3. cccccccccccccccccccc
- 4. dd
- 5. eeeeeeeeeeee"""
- rx = re.compile(r'(.)1{9,}')
- lines = txt.split('n')
- for line in lines:
- rxx = rx.search(line)
- if rxx:
- print line
- 1. aaaaaaaaaaaaaaa
- 3. cccccccccccccccccccc
- 5. eeeeeeeeeeee
- $: cat > test
- ========
- ============================
- oo
- ooooooooooooooooooooooo
- $: grep -E '(.)1{10}' test
- ============================
- ooooooooooooooooooooooo
- ={10,}
- $: cat > testre
- ============================
- ==
- ==============
- $: grep -E '={10,}' testre
- ============================
- ==============
Add Comment
Please, Sign In to add comment