Solved

Display arabic alphabet with Vb.Net

Posted on 2010-11-28
4
799 Views
Last Modified: 2012-05-10
I'm use this statement to display english alphabet but I want to display arabic alphabet

Dim words As MatchCollection = Regex.Matches(text, "\b[a-zA-Z]+\b")

Open in new window

0
Comment
Question by:ty-exexch-ko
  • 3
4 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 34225935
I'm confused. You say you are displaying an English alphabet, but you are showing a regex, which would be used to match patterns, or in this case English letters. Are you saying you want to match Arabic characters? If so, you should be able to just paste in the range using charmap (or if you have an Arabic keyboard). You'll probably need to set the RightToLeft option on your regex.

Here is an example--forgive me, I cannot read Arabic, so this may not make sense as I pulled it from the following site:  http://www.shariahprogram.ca/Arabic-alphabet.shtml

Please note the structure of the code (I am including an image in case EE doesn't display the characters properly). It also seems that word boundary has an issue with Arabic script. I may be doing something incorrectly though. You'll have to experiment with that part of the pattern.
string text = "¿¿¿ ¿¿¿¿ ¿¿¿¿ ¿¿¿¿";
MatchCollection words = Regex.Matches(text, "[¿-¿]+");

Open in new window

Untitled.png
0
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 34225944
Note:  Instead of pasting in the characters, you can also denote Arabic characters in your pattern by specifying their unicode values:
MatchCollection words = Regex.Matches(text, "[\u0600-\u06FF]+");

Open in new window

0
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 34225949
The VB version:
Dim text As String = "¿¿¿ ¿¿¿¿ ¿¿¿¿ ¿¿¿¿"
Dim words As MatchCollection = Regex.Matches(text, "[¿-¿]+")

Open in new window

0
 

Author Comment

by:ty-exexch-ko
ID: 34227259
I will test this code and return back.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now