Angular 2: Katakana Regex

285 Views Asked by At

I want to validate if the inputted text is in Katakana.

I have this:

Validators.pattern('[\u30A0-\u30FF]+')

But I also want to accept spaces in between. What should I add?

1

There are 1 best solutions below

1
Char On

I solved this problem. I added \.<space>

Validators.pattern('[\u30A0-\u30FF\. ]+')

This accepts Katakana characters and space/s in input field