Search code examples
c++cregexlocale

Regex. Find all words with non latin characters


How can I find all words with at least one non latin letter (arabic, chinese...) in them using regex.h library?

cityدبي


Solution

  • How about:

    (?=\pL)(?![a-zA-Z])
    

    This will match a letter in any alphabet that is not a latin letter:

    not ok - cityدبي
    ok - city
    not ok - دبي