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 

python docs say:

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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -