Answers for "python regex type hint"

0

python regex type hint

from typing import Pattern, Match
import re

my_pattern = re.compile("[abc]*")  # type: Pattern[str]
my_match = re.match(my_pattern, "abbcab")  # type: Match[str]
print(my_match)
Posted by: Guest on April-02-2022

Python Answers by Framework

Browse Popular Code Answers by Language