python - regex, matching optional dot before \b -
i have bunch of street names, , trying clean street names "st augustine" , "st. augustine" can replace them "saint augustine" trying match either "st" or "st.", , tried using following, doesn't seem match dot. using python.
\bst\.?\b
in python’s string literals, \b backspace character, ascii value 8. if you’re not using raw strings, python convert \b backspace, , re won’t match expect to.
so im guessing (because lack of information post) solution problem r'\bst\.?\b'
(raw string, otherwise \b
means backspace).
Comments
Post a Comment