Solved

Display arabic alphabet with Vb.Net

Posted on 2010-11-28
4
819 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 75

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 75

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 75

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

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.

710 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