python - Check if string matches pattern - Stack Overflow


PHOTO EMBED

Wed Aug 12 2020 03:09:20 GMT+0000 (UTC)

Saved by @omzep #regex #python #match

import re
if re.match(r"hello[0-9]+", 'hello1'):
    print('Yes')
content_copyCOPY

https://stackoverflow.com/questions/12595051/check-if-string-matches-pattern