Home > Enterprise >  How can I remove arabic words from turkish string with regex?
How can I remove arabic words from turkish string with regex?

Time:08-15

I want to remove all arabic words from my string. How can I remove arabic words with regex in python?

**Input** = " Bugün hava صباح الخير çok صباح الخير güzel"

**Output** = "Bugün hava çok güzel"

Thanks for help

CodePudding user response:

Assuming that you want to remove all Arabic words from a string, you could use the following regex:

\b[\u0600-\u06FF] \b

This regex will match any word that contains at least one Arabic character.

  • Related