Answer the question
In order to leave comments, you need to log in
How to write a regular expression in Python?
How to write a function that outputs from a large string only the part where there is 1 lowercase letter that is between 3 uppercase letters on each side
i.e.: YVYhROP and output only those lowercase characters : h
Answer the question
In order to leave comments, you need to log in
import re
string = "YVYhROP"
res = re.search(r'[А-ЯЁA-Z]{3}([а-яёa-z])[А-ЯЁA-Z]{3}', string)
print(res.group(1))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question