Raju23c
(Rajasekar )
1
Hi folks, Can anyone please help me on this.
Need to find if the string contains any arabic text or numbers, if that exists means i need to remove the arabic words alone from it.
Sample
Input String - الإجراء المطلوب عزيزى المورد تمت الموافقة على اتفاقية شراء عامة جديد رقم (94411-A)
Output - (94411-A)
Input String - الإجراء المطلوبabcd123عزيزى المورد تمت الموافقة على اتفاقية شراABCء عامة جدي
Output - abcd123ABC
mz3bel
(Mohssine HILAL)
2
Raju23c
(Rajasekar )
3
Hi @mz3bel …thanks for your input, i tried this and its not working for the sample input that i gave.
Adrian_Star
(Adrian Starukiewicz)
4
Hi,
check:
System.Text.RegularExpressions.Regex.IsMatch(your_String,".[a-zA-Z0-9-()]")
Arabic text is respresented as non-word character.
Or use nagation of Arabic characters like:
System.Text.RegularExpressions.Regex.IsMatch(your_String,"[\P{Arabic}\s\p{N}]")
Replace:
System.Text.RegularExpressions.Regex.Replace(your_String,"[\p{Arabic}\s]","")
Sources:
http://www.regular-expressions.info/unicode.html#category
https://www.fileformat.info/info/unicode/category/index.htm
1 Like
Yoichi
(Yoichi)
5
Hi,
Can you try the following?
System.Text.RegularExpressions.Regex.Replace(yourString,"\p{IsArabic}","")
Regards,