How to Use Regular Expressions to Distinguish National Languages in Swift
- String(“안녕하세요”).range(of: “\\p{Hangul}”, options: .regularExpression)
True
- String(“Say Hello”).range(of: “\\p{Hangul}”, options: .regularExpression)
False
- \p{Common}
- \p{Arabic}
- \p{Armenian}
- \p{Bengali}
- \p{Bopomofo}
- \p{Braille}
- \p{Buhid}
- \p{Canadian_Aboriginal}
- \p{Cherokee}
- \p{Cyrillic}
- \p{Devanagari}
- \p{Ethiopic}
- \p{Georgian}
- \p{Greek}
- \p{Gujarati}
- \p{Gurmukhi}
- \p{Han}
- \p{Hangul}
- \p{Hanunoo}
- \p{Hebrew}
- \p{Hiragana}
- \p{Inherited}
- \p{Kannada}
- \p{Katakana}
- \p{Khmer}
- \p{Lao}
- \p{Latin}
- \p{Limbu}
- \p{Malayalam}
- \p{Mongolian}
- \p{Myanmar}
- \p{Ogham}
- \p{Oriya}
- \p{Runic}
- \p{Sinhala}
- \p{Syriac}
- \p{Tagalog}
- \p{Tagbanwa}
- \p{TaiLe}
- \p{Tamil}
- \p{Telugu}
- \p{Thaana}
- \p{Thai}
- \p{Tibetan}
- \p{Yi}
ref:
Regex Tutorial - Unicode Characters and Properties
_Edit description_www.regular-expressions.info