I am currently using re.findall to search and highlight words after the '#' character for hash tags in a string:
hashtags = re.findall(r'#([A-Za-z0-9_]+)', str1)
It searches str1 and finds all hashtags. This works, however, it does not take into account accented characters such as these, for example: áéíóúñü¿ .
If one of these letters is in str1, it will save the hash tag up to the letter in front of it. So, for example, #yogenfrüz will be #yogenfr .
I need to take into account all letters with an accent, which vary from German, Dutch, French and Spanish, so that I can save hashtags, for example #yogenfrüz
How can i do this
python django regex hashtag non-ascii-characters
noahandthewhale
source share