Find Greek characters using regex

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
danielrr
Posts: 142
Joined: Mon Mar 04, 2013 4:03 pm

Find Greek characters using regex

Post by danielrr »

HI all!

I have a few questions concerning using regex to find strings in Ancient Greek, but I think I will be able to solve most of them if I knew the way to find any string containing just Ancient Greek text in livecode. (something like [Α-Ωα-ω] will omit any accented character).

In plain English, how do I build, for example, the regex to find any Greek word of 5 chars, or any Greek word with first character Ἀ?

best,

Daniel
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Find Greek characters using regex

Post by bogs »

Probably one of the best regex pages I've come across is this one.
Image
danielrr
Posts: 142
Joined: Mon Mar 04, 2013 4:03 pm

Re: Find Greek characters using regex

Post by danielrr »

I'll put it another way: Greek letter lambda (λ) is Unicode 955, hex U+03BB and in languages like python "\u03bb". how do you represent Unicode characters like lambda in regex expressions using livecode? and how do you set the range of characters to look for when searching for Unicode characters?
bwmilby
Posts: 463
Joined: Wed Jun 07, 2017 5:37 am
Contact:

Re: Find Greek characters using regex

Post by bwmilby »

See this page for details:

http://www.pcre.org/original/doc/html/pcrepattern.html

You can use "\p{Greek}"

For the specific example, use "\x{03bb}"
danielrr
Posts: 142
Joined: Mon Mar 04, 2013 4:03 pm

Re: Find Greek characters using regex

Post by danielrr »

oh, that's great!. Almost all my questions answered in just one post! thanks bwmilby :D
Post Reply