Does anyone know, what the german regex for/ with umlauts is?
const string = 'Aktivitäten und Ausflugsziele in der Nähe von keyword.'
function getTags ( string ) {
let tags = []
string = string.toLocaleLowerCase()
tags = string.match(/\b(\w+)\b/g)
return tags
}
This regex /\b(\w+)\b/g
does work perfect. However umlauts result in something like that..
[ 'aktivit', 'ten', 'und', 'ausflugsziele', 'in', 'der', 'he', 'von', 'keyword' ]
Now I tried to use this regex. /\b(\w+[0-9a-zäöüÄÖÜ])\b/g
, which seems to get closer to the expected result, but somehow I cant find the end of the word.
[ 'aktivitä', 'ten', 'und', 'ausflugsziele', 'in', 'der' 'nä', 'he', 'von', 'keyword' ]
Does anyone know the correct regex to fix german umlauts? Expected output:
[ 'aktivitäten', 'und', 'ausflugsziele', 'in', 'der, 'nähe', 'von', 'keyword' ]