Match Unicode letters with RegExp

I need to combine Unicode letters, similar to PCRE \p{L}.

Now, since the Dart RegExp class is based on ECMAScript, it has no idea \p{L}, unfortunately.

I am looking, perhaps, for creating a large character class that matches all Unicode letters, but I'm not sure where to start.

So, I want to match letters like:

foobar
מכון ראות

But the character R must not match:

BlackBerry®

Also, there should not be any ASCII control characters or punctuation marks, etc. Essentially every letter in every Unicode language supports, whether å, ä, φ or ת, they must match if they are actual letters.

+5
source share
3 answers

, , .

Golang unicode source. . maketables.go unicode golang.

Dart-, , Dart ;)

+2

, - - . , - , Intl, Bidi. , , ,

isLetter (oneCharacterString) = > Bidi.endsWithLtr(oneLetterString) || Bidi.endsWithRTL(oneLetterString);

. , -, . RegExp _LTR_CHARS _RTL_CHARS. , 100% , .

+2

There is no support in Dart or JS yet.

The Xregexp JS library supports creating fairly large character class regular expressions to support something like this. You can create a regular expression, print it, and cut and paste it into your application.

+2
source

All Articles