Regex ?

Olaan

Expert
Licensed User
Longtime User
Hi all,
Who is well known about Regex in B4A? Please explain me clearly?
Could I match Thaiword with mp3 File? I don't know about using pattern.

Best Regards
Theera
 
Last edited:
Please give me the example: IsThai(word) as boolean?

I don't know to use regex ? This is Thai unicode.
Please help me give example i.e. How to coding function IsThai(word) as boolean ?

P.S. Unicode Thai(UTF-8) is the same as Unicode Thai(UTF-8 without BOM)?

Best Regards
Theera
 
Upvote 0
You do not need to use Regex for this. You should check the value returned from Asc(SomeCharacter) and see whether it is in the block of Thai characters.

Something like:
Code:
Sub IsThai(s As String) As Boolean
   For i = 0 To s.Length - 1
      Dim codePoint As Int = Asc(s.CharAt(i))
      If codePoint >= 0x0E00 AND codePoint <= 0x0E7F Then Return True
   Next
   Return False
End Sub
 
Upvote 0
Can I use pattern with regex()?

Hi Erel,
I have ever seen Java using Pattern, Pattern="[ก-ฮ0-9ฯ-๙]*"
I don't know that Can I use pattern with regex()? If I can,then
if I define "เอาะ"="-oh" then "เกาะ"="Koh" too. How to coding?

P.S. "เกาะ" is mean "land"

Best Regards
Theera
 
Last edited:
Upvote 0
Ask to learn more.

Hi Erel,
Is there a possibility or not that made error?,If I check many languages in your strategy post #4. I mean that data of langauges used in the same location between 0x0E00-0x0E7F.

Best Regards
Theera
 
Last edited:
Upvote 0
Back
Top