escape brackets in regex python code example Example: escape brackets in regex python r'\b\[harry\]\b'