Regular Expressions 101

Community Patterns

Python Type Hint Remover

0

Regular Expression
PCRE (PHP <7.3)

/
(:\s?[a-zA-Z_\[\"][a-zA-Z0-9_\]\"]*)|(\s*->\s*[a-zA-Z_\[\"][a-zA-Z0-9_\]\"]*)
/
gm

Description

A RegEx pattern tasked with matching all python type hints to enable simple removal in order to make the code compatible with python<v3.5.

Submitted by anonymous - 6 years ago