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: Klaus, FourthWorld, heatherlaine, kevinmiller

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

Find Greek characters using regex

Post by danielrr » Sat Apr 07, 2018 12:39 pm

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: 4675
Joined: Sat Feb 25, 2017 10:45 pm

Re: Find Greek characters using regex

Post by bogs » Sat Apr 07, 2018 2:22 pm

Probably one of the best regex pages I've come across is this one.
Image

danielrr
Posts: 117
Joined: Mon Mar 04, 2013 4:03 pm

Re: Find Greek characters using regex

Post by danielrr » Sat Apr 07, 2018 4:06 pm

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: 299
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Find Greek characters using regex

Post by bwmilby » Sat Apr 07, 2018 6:30 pm

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}"
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

danielrr
Posts: 117
Joined: Mon Mar 04, 2013 4:03 pm

Re: Find Greek characters using regex

Post by danielrr » Sun Apr 08, 2018 2:08 pm

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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”