regular expression | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

regular expression

how can i search '1~10' ?? I need list '1~10' s = ["1 line.", "2 line.", "3 line." ..........."10 line."] p = re.compile('[0-9]+') result = p.findall(s) print(result) output Traceback (most recent call last): File "e:\Google drive\0.Baikal\02 ź³µė¶€\ģøķ”„ėŸ°\python basic_02.py", line 58, in <module> result = p.findall(s) TypeError: expected string or bytes-like object https://code.sololearn.com/W961F9nI3Agi/?ref=app

22nd Aug 2021, 1:51 PM
ģ›ģœ ź¶Œ
2 Respostas
+ 1
Did you accidentally put that link in the Description? it is not your code. You can edit the thread and change that link to the one that actually points to the code in question, in order for the people to check it, and suggest accordingly šŸ‘
22nd Aug 2021, 3:09 PM
Ipang
+ 3
It is expecting string or bytes like object but you are giving it a list. And why did you added a code in description that has nothing to do with your question ?
22nd Aug 2021, 3:05 PM
Abhay
Abhay - avatar