python - How to detect if string "_numbers" here -
i need detect, if string contains "_numbers", e.g.:
"4myluv3_27113.jpg" - true , "5cr00g3.jpg" - false , "joshua969.jpg"- false , "20comer100saber_lol.jpg" - false
the number may have 1 6 digits. answer!
use re.search
if re.search(r'_\d{1,6}\b', s):
Comments
Post a Comment