Matchtext/Regex Case Insensitive Flag
Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 349
- Joined: Mon Jun 10, 2013 1:32 pm
Matchtext/Regex Case Insensitive Flag
Hi
I've been trying to get Matchtext to match 3 diifferent words but just incase wanted too make it case insensitive. In my current routine it doesn't really matter.
Im trying matchtext(lcString,"Note|Name|Add") which works but if i add /i to make it case insensitive, it has no effect unless there is a LC way of adding it.
I have use forward slash and backslash (just in case) and it doesn't work.
Regards Lagi
I've been trying to get Matchtext to match 3 diifferent words but just incase wanted too make it case insensitive. In my current routine it doesn't really matter.
Im trying matchtext(lcString,"Note|Name|Add") which works but if i add /i to make it case insensitive, it has no effect unless there is a LC way of adding it.
I have use forward slash and backslash (just in case) and it doesn't work.
Regards Lagi
-
- VIP Livecode Opensource Backer
- Posts: 349
- Joined: Mon Jun 10, 2013 1:32 pm
Re: Matchtext/Regex Case Insensitive Flag
Hi
Since nobody has piped up I have to assume it doesn't work and since the livecode documentation says it is PCRE compatible that means it's a bug.
Or is this just an Undocumented Feature?
I even used s"et the casesensitive to false" and that had no effect either so I have reverted to a kludge by enclosing the match string in a toupper().
Is there a list of where LC doesn't agree with the PCRE "standard".
Regards Lagi
Since nobody has piped up I have to assume it doesn't work and since the livecode documentation says it is PCRE compatible that means it's a bug.
Or is this just an Undocumented Feature?
I even used s"et the casesensitive to false" and that had no effect either so I have reverted to a kludge by enclosing the match string in a toupper().
Is there a list of where LC doesn't agree with the PCRE "standard".
Regards Lagi
-
- VIP Livecode Opensource Backer
- Posts: 817
- Joined: Wed Nov 22, 2006 3:42 pm
- Location: France
- Contact:
Re: Matchtext/Regex Case Insensitive Flag
Hi Laggi,

In Livecode, just do that:
All options (or mode) are in front of the Regex.
Same for multi-line, dot-match,...
HTH,
Thierry
Hey, you're jumping a bit too fast to the conclusion, which is wrong by the wayLagi Pittas wrote: Since nobody has piped up I have to assume it doesn't work

It is documented somewhere in the dictionnary..and since the livecode documentation says it is PCRE compatible that means it's a bug.
Or is this just an Undocumented Feature?
Good try, but unrelated to regex.I even used s"et the casesensitive to false"
LC uses PCRE 8.33 library and as far as I know, it respects the PCRE standard.Is there a list of where LC doesn't agree with the PCRE "standard".
In Livecode, just do that:
Code: Select all
if matchText( T, "(?i)x|y|z" ) then ..
Same for multi-line, dot-match,...
HTH,
Thierry
Thierry Douez
- Senior computer scientist
- Conseil, dévelopement et support en Français
https://sunny-tdz.com
https://sunny-tdz.com/livecode/externals
- Senior computer scientist
- Conseil, dévelopement et support en Français
https://sunny-tdz.com
https://sunny-tdz.com/livecode/externals
-
- VIP Livecode Opensource Backer
- Posts: 349
- Joined: Mon Jun 10, 2013 1:32 pm
Re: Matchtext/Regex Case Insensitive Flag
Thanks Thierry
RTFM (read The Fine Manual)
Went back and saw this
The problem was I ASSumed that it would be in the same order as it gave me no error - but reconsidering it was taking them as characters.
I was clutching at straws with the the casesensitive flag
But Anyways my subtle plan worked - call it a bug and the "Knights of LiveCode" will appear
As McDonalds would say "I'm lovin It!!"
Thanks again Thierry
RTFM (read The Fine Manual)
Went back and saw this
Code: Select all
The string and regularExpression are always case-sensitive, regardless of the setting of the caseSensitive property. (If you need to make a case-insensitive comparison, use "(?i)" at the start of the regularExpression to make the match case-insensitive.)
I was clutching at straws with the the casesensitive flag
But Anyways my subtle plan worked - call it a bug and the "Knights of LiveCode" will appear

As McDonalds would say "I'm lovin It!!"

Thanks again Thierry
-
- VIP Livecode Opensource Backer
- Posts: 817
- Joined: Wed Nov 22, 2006 3:42 pm
- Location: France
- Contact:
Re: Matchtext/Regex Case Insensitive Flag
Unfortunately, not always trueLagi Pittas wrote:Thanks Thierry
RTFM (read The Fine Manual)

Wrong conclusion againBut Anyways my subtle plan worked - call it a bug and the "Knights of LiveCode" will appear![]()

When I post my previous answer, I would have done it with your 1st post too.
Just pass here during my free time...
Plus, for most of livecoders, regexes are just hellish

Here, I'm lostAs McDonalds would say "I'm lovin It!!"![]()

Best,
Thierry
Thierry Douez
- Senior computer scientist
- Conseil, dévelopement et support en Français
https://sunny-tdz.com
https://sunny-tdz.com/livecode/externals
- Senior computer scientist
- Conseil, dévelopement et support en Français
https://sunny-tdz.com
https://sunny-tdz.com/livecode/externals
-
- VIP Livecode Opensource Backer
- Posts: 349
- Joined: Mon Jun 10, 2013 1:32 pm
Re: Matchtext/Regex Case Insensitive Flag
Hi Thierry,
In this case it WAS true, but usually F stands for something else ....
With 50 views and no answer what could I Assume - I just should have read 1 line further in the Docs.
I'M loving it - means I'm enjoying LC - there are many things that could be better - especially the IDE crashing more in 1 Day (not just 1 day) than the VISUAL FOXPRO IDE crashed in 20 years and no that is not an exaggeration.
There isn't much I can see that can't be done with LC - just having to adapt to new paradigms and expectations of how things work rather than the way I expect thenm to - thats why I'm Lovin' it.
Regards Lagi
In this case it WAS true, but usually F stands for something else ....
With 50 views and no answer what could I Assume - I just should have read 1 line further in the Docs.
I'M loving it - means I'm enjoying LC - there are many things that could be better - especially the IDE crashing more in 1 Day (not just 1 day) than the VISUAL FOXPRO IDE crashed in 20 years and no that is not an exaggeration.
There isn't much I can see that can't be done with LC - just having to adapt to new paradigms and expectations of how things work rather than the way I expect thenm to - thats why I'm Lovin' it.
Regards Lagi