Home > Enterprise >  Is there python Function to remove word between special character and space
Is there python Function to remove word between special character and space

Time:03-08

I'm trying to remove the *@hmo2406* word using the below function. Could you check and help me?

'*@hmo24* وين هل الغيبه  '

>>> import re
>>> re.sub('\n@.*?\n','',a, flags=re.DOTALL)

CodePudding user response:

If you're removing non-Arabic characters from your string then try this:

import re 

text = '*@hmo24* وين هل الغيبه  '

arabic_string = " ".join(re.findall('[\u0600-\u06ff] ', text))

print(arabic_string)

Output:

وين هل الغيبه
  • Related