Regular Expressions 101

Community Patterns

python-unicode-hashtags

1

Regular Expression
Python

r"
(?:^|_|[^\w&/]+)(?:#|)([\wÀ-ÖØ-öø-ÿ]+)
"
gui

Description

Because 're' module in python do not support \p{L} unicode class need to use simplistic regex with \w instead \p{L}. But such regexp also match digits like #123, #003 and so on. So it need to further filter out digit-only tags.

Submitted by Stanislav Otovchits - 8 years ago