The timings I posted are distorted by what appears to be a bug in LC.
For details, see http://forums.livecode.com/viewtopic.php?f=104&t=28513.
@-hh: Thanks for the suggestion about including the latest version of all submissions, and for the suggestion about testing in other versions of LC, and for deleting the post that contained the suggestions.
@Thierry: It's your regex that exposes the side effect.
@capellan: You're welcome.
-- Dick
Pattern Matching in Livecode
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Pattern Matching in Livecode
@Thierry
Your code and data posted here Thu Nov 10, 2016 11:28 am gave me a good, working, starting point for comparing this thread's functions; my code evolved from yours to suit my purposes. So, thanks for the head start.
Besides that, your first regex contribution turned out, in my opinion, to be by far the best solution because it took so little time to code, especially compared to mine.
-- Dick
Your code and data posted here Thu Nov 10, 2016 11:28 am gave me a good, working, starting point for comparing this thread's functions; my code evolved from yours to suit my purposes. So, thanks for the head start.
Besides that, your first regex contribution turned out, in my opinion, to be by far the best solution because it took so little time to code, especially compared to mine.
-- Dick
Re: Pattern Matching in Livecode
Dirk,rkriesel wrote:@Thierry
Your code and data posted here Thu Nov 10, 2016 11:28 am gave me a good, working, starting point for comparing this thread's functions; my code evolved from yours to suit my purposes. So, thanks for the head start.
Your contribution was even stronger to me:
you have opened the door to identify 2 internal LC bugs which are patched by now.
THIS unblock my sunnYrex library which I could release right after understanding
the patches made by @LCmark, and I got my first customer the same day!
Ok, part of the true story:Besides that, your first regex contribution turned out, in my opinion,
to be by far the best solution because it took so little time to code.
Reading the 1st post, I didn't understand what to do,
but later, reading Hermann's post then I did but I was too busy then.
Next day, sitting in front of an open fire with a cat on my knees and a cup of coffee,
I could instantly visualize the regex.
and back to the computer, it took me less than 10 minutes to code and post.
Here is the true power of regex; but for that one need to know the syntax and be at ease with
the regex engine.
To summarize:
- regex are usually fast to execute if properly used
- they are fast to code too if used in an appropriate way
- but some say it's hard to read: well, see below
Here is the extended regex of my 1st post:
Code: Select all
^(?:(?:1GHO|2GFD|2GFO|2PLS|2RHD|2RHO|2RHS|3GLO|3PFS|3PHD|3PHS|3PLD)\s){3}
Happy Christmas to all,
Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!