osk
osk

Reputation: 810

Regex to match swedish words but not numbers

So I have made a regex (in Python) that currently matches all words but ignores special characters.

/([\wåäöÅÄÖ]+)/g

However, it also matches numbers. How can I make it so that it does not match numbers?

Upvotes: 0

Views: 1211

Answers (1)

Take_Care_
Take_Care_

Reputation: 2144

The \w character class is equivalent to [A-Za-z0-9_].

So maybe:

[åäöÅÄÖA-Za-z_]+

will be better choice

Upvotes: 3

Related Questions