A
A
Anton2021-09-30 06:05:04
Python
Anton, 2021-09-30 06:05:04

How to add uppercase and lowercase characters to this regular expression?

Greetings.
Tell me how to correctly write this regular expression for upper and lower letters and numbers.
regex = re.compile(r'.*(.)(\1)(\1)(\1).*$')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
o5a, 2021-09-30
@boypush

Read about flags. In this case add re.I
regex = re.compile(r'.*(.)(\1)(\1)(\1).*$', re.I)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question