Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #regex #type #hint
ADD COMMENT
Topic
Name
2+2 =