D
D
dimaviolinist2018-06-05 20:24:17
Python
dimaviolinist, 2018-06-05 20:24:17

How to check if there are letters in a string in Python?

I can't write a regular expression.
It is necessary to determine if there are letters (any, mostly Cyrillic) in the string.
PS Solution below in comments, thanks longclaps
print(re.search(r'[^\W\d]', 'someth111ing'))
print(re.search(r'[^\W\d]', 'something' ))
print(re.search(r'[^\W\d]', '12443'))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
longclaps, 2018-06-05
@dimaviolinist

enough in the third python
r'\w'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question