Re: Filter with wildcards

2023-11-02 Thread Neville Smythe via use-livecode
Users should certainly never see regex! That’s covered in User  Interface 
Guidelines 101.

But surely you wouldn’t show them the LC wildcard filter either!

$@%?$@%?$@%?$@%?$@%?$@%?$@%?$@%?
Neville Smythe
Director, International Go Federation
VicePresident, Australian Go Association Inc.

> On 3 Nov 2023, at 12:02 am, David Glasgow  wrote:
> 
> 
> 
>> On 1 Nov 2023, at 11:24 pm, Neville Smythe  
>> wrote:
>> 
>> But I suspect you should allow for the required strings to be followed by 
>> punctuation or be at the end of the line, things which are hard to do with a 
>> simple LC wildcard search, at least in a single filter. 
> 
> 
> When I originally went down the wildcard route, I wrote some gentle text 
> preprocessing (using replace) to make sure words are always bounded by a 
> space, including before punctuation and at an eol.
> 
> I also need users to see the reason  the message appears in the results (i.e 
> the matched filter) so  they are listed under a heading consisting of the 
> search term.  Not sure what users would make of regex!
> 
> Thanks again,
> 
> Cheers
> 
> David G
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter with wildcards

2023-11-02 Thread David Glasgow via use-livecode



> On 1 Nov 2023, at 11:24 pm, Neville Smythe  
> wrote:
> 
> But I suspect you should allow for the required strings to be followed by 
> punctuation or be at the end of the line, things which are hard to do with a 
> simple LC wildcard search, at least in a single filter. 


When I originally went down the wildcard route, I wrote some gentle text 
preprocessing (using replace) to make sure words are always bounded by a space, 
including before punctuation and at an eol.

I also need users to see the reason  the message appears in the results (i.e 
the matched filter) so  they are listed under a heading consisting of the 
search term.  Not sure what users would make of regex!

Thanks again,

Cheers

David G
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter with wildcards

2023-11-01 Thread Neville Smythe via use-livecode
I agree David, regular expressions look intimidating at first sight. But in 
fact if you compare your intuitive attempt

filter tList with “*with [you,u] *”

with the regex which does what you set out to do

filter tList with regex “.*with (you|u) .*”

they are almost exactly the same – for very good reasons of course. The . is 
just the regex for a single character, the * says “any number incuding 0 of the 
preceding pattern”.

I don’t know your actual use-case, the above may be enough for all your 
searches, But I suspect you should allow for the required strings to be 
followed by punctuation or be at the end of the line, things which are hard to 
do with a simple LC wildcard search, at least in a single filter. 

The final tweak to account for a case insensitive search adds a flag at the 
front the of the regex (and I agree is rather arcane). If you want arcane, 
there is a possibly  better way to do the regex search for either the whole 
word “you" or the whole word “u”. You can use the code “\b” to indicate  a word 
boundary instead of a character, that is white space, punctuation or line start 
or end. 

filter tList with regex “.*with\b(you|u)\b.*”

As usual with a complex language there are alternative ways of accomplishing 
the same thing. Hmm, if to be truthful, my previous regex doesn’t do precisely 
the same thing as looking for word boundaries (hyphens, numbers, hard 
spaces…human language is so complicated).

I opine that regular expressions and sql are the two most useful technologies 
to add to the LC developer’s toolbox. After some basic user interface design 
principles course. Beyond those lie the web languages html, css, javascript 
(shudder). And then LCB, something I have yet to tackle.

BTW, apologies for the “numeric” when I meant “alphabetic” in the previous 
email. It seems I cannot write an email these days without at leat one mistke.

Neville

> On 1 Nov 2023, at 7:54 pm, David V Glasgow  wrote:
> 
> This is the thing about regex, amazing,powerful, impressive, but scary as 
> hell.
> 
> I will play with this a little, though… so thanks for your time when you 
> should have been doing something else.  I appreciate it. 
> 
> Best Wishes,
> 
> David Glasgow
> Consultant Forensic & Clinical Psychologist
> Carlton Glasgow Partnership
> Director, Child & Family Training, York
> Honorary Professor (SOCAMRU), Nottingham Trent University
> 
> LinkedIn Profile
> 
>> On 31 Oct 2023, at 8:59 pm, Neville Smythe via use-livecode 
>> mailto:use-livecode@lists.runrev.com>> wrote:
>> 
>> Forgot any number of other chars after the non-numeric character
>> 
>> Filter tList with regex "(?i).*with (you|u)([^a-zA-Z].*|$)”
>> 
>> Now I’ve really got to go … hope I’ve got it all right this time! 
>> 
>> Neville Smythe




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter with wildcards

2023-11-01 Thread David V Glasgow via use-livecode
This is the thing about regex, amazing,powerful, impressive, but scary as hell.

I will play with this a little, though… so thanks for your time when you should 
have been doing something else.  I appreciate it. 

Best Wishes,

David Glasgow
Consultant Forensic & Clinical Psychologist
Carlton Glasgow Partnership
Director, Child & Family Training, York
Honorary Professor (SOCAMRU), Nottingham Trent University

LinkedIn Profile

> On 31 Oct 2023, at 8:59 pm, Neville Smythe via use-livecode 
>  wrote:
> 
> Forgot any number of other chars after the non-numeric character
> 
> Filter tList with regex "(?i).*with (you|u)([^a-zA-Z].*|$)”
> 
> Now I’ve really got to go … hope I’ve got it all right this time! 
> 
> Neville Smythe
> 
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter with wildcards

2023-11-01 Thread David Glasgow via use-livecode
Thanks all for the suggestions, folks.

I expected someone to mention regex (shudder).  I have many searches in a loop 
and most are simple strings, so excepting regex filters would be a bit of a 
pain (unless of course I could specify regex but this would not choke if the 
search was simple string containing no regular expressions)

Because I am lazy, and a simple soul, I will probably just  split the task into 
two filter commands - which will deliver exactly what I want at only a minimal 
time and thought overhead.

Cheers

David G

> On 30 Oct 2023, at 7:29 pm, Mark Waddingham via use-livecode 
>  wrote:
> 
> The filter command has had a ‘with[out] regex’ form for a long time - so I’d 
> use a regex instead :)
> 
> (I’m pretty sure [ ] is a set of characters to match, rather than a list of 
> sub strings, in wildcard expressions)
> 
> Warmest Regards,
> 
> Mark.
> 
> Sent from my iPhone
> 
>> On 30 Oct 2023, at 17:19, David Glasgow via use-livecode 
>>  wrote:
>> 
>> Hi folks,
>> 
>> I am doing the above and struggling with an oddity that I can’t find 
>> guidance on on Livecode or wider wildcard stuff
>> 
>> A simple example is I am searching text messages for 'with you' or 'with u’
>> 
>> so I use the wildcard form
>> 
>> *with [you,u]*
>> 
>> That finds all examples of both just fine.  However, it also finds ‘with 
>> unlimited cheese’ and 'with us’, ‘with yours’ etc.  so I want a space after 
>> both u
>> 
>> When I put two spaces inside the square brackets after each string, the 
>> search still works but spaces seem to be ignored (so still finds the above 
>> resamples I don’t want).
>> 
>> If I put a single space after the brackets the first bracketed string is 
>> ignored and the filter only finds “with u “
>> 
>> Hope someone can help me stop pulling my baffled face
>> 
>> Cheers
>> 
>> David Glasgow
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter with wildcards

2023-10-31 Thread Neville Smythe via use-livecode
Forgot any number of other chars after the non-numeric character

Filter tList with regex "(?i).*with (you|u)([^a-zA-Z].*|$)”

Now I’ve really got to go … hope I’ve got it all right this time! 

Neville Smythe




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter with wildcards

2023-10-31 Thread Neville Smythe via use-livecode
Filter tList with regex "(?i).*with (you|u)( .*|\.|$)"

I did forget something … wth you might be folllowed by a comma or colon or 
something so the last brackets should search for either any non alphabetic 
character or the end of line, so think (going from memory here)

Filter tList with regex "(?i).*with (you|u)([^a-zA-Z]|$)”


Neville Smythe




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter with wildcards

2023-10-31 Thread Neville Smythe via use-livecode
Reglar expressions is definitely the way to go

So you want to catch any number of characters
.*
Followed by the string “with “
.*with 
Followed by either “you” or “u”
.*with (you|u)
Followed by a space and then any umber of characters, giving
.*with (you|u) .*

Except you might want to look for lines ending in with you, or a period
.*with (you|u)( .*|\.|$)

And what about “With You”. Since regex is case sensitive by default 
(?i).*with (you|u)( .*|\.|$)

Filter tList with regex "(?i).*with (you|u)( .*|\.|$)"

Writing this in a rush so I hope I haven’t got that wrong

Neville Smythe




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter with wildcards

2023-10-30 Thread Mark Waddingham via use-livecode
The filter command has had a ‘with[out] regex’ form for a long time - so I’d 
use a regex instead :)

(I’m pretty sure [ ] is a set of characters to match, rather than a list of sub 
strings, in wildcard expressions)

Warmest Regards,

Mark.

Sent from my iPhone

> On 30 Oct 2023, at 17:19, David Glasgow via use-livecode 
>  wrote:
> 
> Hi folks,
> 
> I am doing the above and struggling with an oddity that I can’t find guidance 
> on on Livecode or wider wildcard stuff
> 
> A simple example is I am searching text messages for 'with you' or 'with u’
> 
> so I use the wildcard form
> 
> *with [you,u]*
> 
> That finds all examples of both just fine.  However, it also finds ‘with 
> unlimited cheese’ and 'with us’, ‘with yours’ etc.  so I want a space after 
> both u
> 
> When I put two spaces inside the square brackets after each string, the 
> search still works but spaces seem to be ignored (so still finds the above 
> resamples I don’t want).
> 
> If I put a single space after the brackets the first bracketed string is 
> ignored and the filter only finds “with u “
> 
> Hope someone can help me stop pulling my baffled face
> 
> Cheers
> 
> David Glasgow
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter with wildcards

2023-10-30 Thread Richmond Mathewson via use-livecode

I think that matchText is what you are looking for.

I have a proof stack which I shall upload to the forums, as obviously 
this is not possible here:


https://forums.livecode.com/viewtopic.php?f=7=38698

Best, Richmond Mathewson.

On 30.10.23 19:17, David Glasgow via use-livecode wrote:

Hi folks,

I am doing the above and struggling with an oddity that I can’t find guidance 
on on Livecode or wider wildcard stuff

A simple example is I am searching text messages for 'with you' or 'with u’

so I use the wildcard form

*with [you,u]*

That finds all examples of both just fine.  However, it also finds ‘with 
unlimited cheese’ and 'with us’, ‘with yours’ etc.  so I want a space after 
both u

When I put two spaces inside the square brackets after each string, the search 
still works but spaces seem to be ignored (so still finds the above resamples I 
don’t want).

If I put a single space after the brackets the first bracketed string is 
ignored and the filter only finds “with u “

Hope someone can help me stop pulling my baffled face

Cheers

David Glasgow


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter with wildcards

2023-10-30 Thread Richmond Mathewson via use-livecode
Oddly enough a matchChunk expression with "with you$" pulls out all the 
'with you' stuff and excludes this sort of thing: 'with youthful 
naivety' . . . which is marvellous


But a matchChunk expression with "with u$" catches nothing!

On 30.10.23 20:11, Craig Newman via use-livecode wrote:

Have not played with a method of keeping it all in one line. But can you filter 
twice, storing the first result and then running it again?

Craig


On Oct 30, 2023, at 1:17 PM, David Glasgow via use-livecode 
 wrote:

Hi folks,

I am doing the above and struggling with an oddity that I can’t find guidance 
on on Livecode or wider wildcard stuff

A simple example is I am searching text messages for 'with you' or 'with u’

so I use the wildcard form

*with [you,u]*

That finds all examples of both just fine.  However, it also finds ‘with 
unlimited cheese’ and 'with us’, ‘with yours’ etc.  so I want a space after 
both u

When I put two spaces inside the square brackets after each string, the search 
still works but spaces seem to be ignored (so still finds the above resamples I 
don’t want).

If I put a single space after the brackets the first bracketed string is 
ignored and the filter only finds “with u “

Hope someone can help me stop pulling my baffled face

Cheers

David Glasgow


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter with wildcards

2023-10-30 Thread Richmond Mathewson via use-livecode

OK: well I had a bash with a set like this:

with unlimited cheese

with you

with u

with udders clagged with glaur

with youthful naivety

and your filter grabbed all of them. :(

I tried this:

with"with [you, u,]*"

and got the same.

On reading in the dictionary I found this:

filtertVar with"[az]*"-- tVar contains all property names beginning with 
a or z


and the problematic phrase is 'beginning with'.

On 30.10.23 19:17, David Glasgow via use-livecode wrote:

Hi folks,

I am doing the above and struggling with an oddity that I can’t find guidance 
on on Livecode or wider wildcard stuff

A simple example is I am searching text messages for 'with you' or 'with u’

so I use the wildcard form

*with [you,u]*

That finds all examples of both just fine.  However, it also finds ‘with 
unlimited cheese’ and 'with us’, ‘with yours’ etc.  so I want a space after 
both u

When I put two spaces inside the square brackets after each string, the search 
still works but spaces seem to be ignored (so still finds the above resamples I 
don’t want).

If I put a single space after the brackets the first bracketed string is 
ignored and the filter only finds “with u “

Hope someone can help me stop pulling my baffled face

Cheers

David Glasgow


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter with wildcards

2023-10-30 Thread Craig Newman via use-livecode
Have not played with a method of keeping it all in one line. But can you filter 
twice, storing the first result and then running it again?

Craig

> On Oct 30, 2023, at 1:17 PM, David Glasgow via use-livecode 
>  wrote:
> 
> Hi folks,
> 
> I am doing the above and struggling with an oddity that I can’t find guidance 
> on on Livecode or wider wildcard stuff
> 
> A simple example is I am searching text messages for 'with you' or 'with u’
> 
> so I use the wildcard form
> 
> *with [you,u]*
> 
> That finds all examples of both just fine.  However, it also finds ‘with 
> unlimited cheese’ and 'with us’, ‘with yours’ etc.  so I want a space after 
> both u
> 
> When I put two spaces inside the square brackets after each string, the 
> search still works but spaces seem to be ignored (so still finds the above 
> resamples I don’t want).
> 
> If I put a single space after the brackets the first bracketed string is 
> ignored and the filter only finds “with u “
> 
> Hope someone can help me stop pulling my baffled face
> 
> Cheers
> 
> David Glasgow
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-20 Thread Bob Sneidar via use-livecode
Yeah, not confusing at all. ;-P

Bob S


On Nov 20, 2020, at 9:55 AM, Mark Wieder via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

On 11/20/20 3:27 AM, David V Glasgow via use-livecode wrote:
Apologies for barging in, but I am confused by regex generally and in this 
specific example by the function of the terminal ‘+’  If you are only finding 
one character, why do you need to specify 'at least one' of one char?

Ha!
Yeah, I actually mistyped that (moi?).

"^\[" is all that's necessary for the filter command.

...but Klaus' form of "[[]*[]]" is actually better if the field has
[500] and then text

--
Mark Wieder
ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-20 Thread Mark Wieder via use-livecode

On 11/20/20 3:27 AM, David V Glasgow via use-livecode wrote:

Apologies for barging in, but I am confused by regex generally and in this 
specific example by the function of the terminal ‘+’  If you are only finding 
one character, why do you need to specify 'at least one' of one char?


Ha!
Yeah, I actually mistyped that (moi?).

"^\[" is all that's necessary for the filter command.

...but Klaus' form of "[[]*[]]" is actually better if the field has
[500] and then text

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-20 Thread David V Glasgow via use-livecode
Apologies for barging in, but I am confused by regex generally and in this 
specific example by the function of the terminal ‘+’  If you are only finding 
one character, why do you need to specify 'at least one' of one char?

Cheers

David G

> On 20 Nov 2020, at 8:44 am, Klaus major-k via use-livecode 
>  wrote:
> 
>> ^ = start at beginning of line
>> \[ = a literal "[" character ("\" escapes whatever comes next)
>> + = at least one of those characters

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-20 Thread Klaus major-k via use-livecode
Hi Mark,

> Am 20.11.2020 um 00:55 schrieb Mark Wieder via use-livecode 
> :
> On 11/19/20 9:09 AM, Klaus major-k via use-livecode wrote:
>> Hi Mark,
>>> Am 19.11.2020 um 18:07 schrieb Mark Wieder via use-livecode 
>>> :
>>> On 11/19/20 7:38 AM, Mark Waddingham via use-livecode wrote:
 I think:
   filter fld 1 with "[[]*"
 Should do the trick...
>>> As an alternative,
>>> filter fld 1 with regex pattern "^\[+"
>>> also does the trick.
>> thanks, but REGEX is still a TAD over my head. ;-)
> Not really...

how do you know? 8-)

> this is at least as simple as what you just coded:
> 
> ^ = start at beginning of line
> \[ = a literal "[" character ("\" escapes whatever comes next)
> + = at least one of those characters

Thank you, now I am ready to challenge Thierry! :-D

> -- 
> Mark Wieder
> ahsoftw...@gmail.com

Best

Klaus

--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-19 Thread Mark Wieder via use-livecode

On 11/19/20 9:09 AM, Klaus major-k via use-livecode wrote:

Hi Mark,


Am 19.11.2020 um 18:07 schrieb Mark Wieder via use-livecode 
:
On 11/19/20 7:38 AM, Mark Waddingham via use-livecode wrote:

I think:
   filter fld 1 with "[[]*"
Should do the trick...

As an alternative,
filter fld 1 with regex pattern "^\[+"
also does the trick.


thanks, but REGEX is still a TAD over my head. ;-)


Not really... this is at least as simple as what you just coded:

^ = start at beginning of line
\[ = a literal "[" character ("\" escapes whatever comes next)
+ = at least one of those characters

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: filter

2020-11-19 Thread Craig newman via use-livecode
Klaus.

I use "filter" here and there, mostly with regex or wildCards. 

But nothing works for me either,:

Filter yourText with "["
Filter yourText where each contains "["

Not sure what is going on. Where is Thieery?

Craig
-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Klaus major-k via use-livecode
Sent: Thursday, November 19, 2020 10:19 AM
To: How to use LiveCode 
Cc: Klaus major-k 
Subject: filter

Hi all,

I am surely missing something here with filter.

I have a field with some lines like:
...
[500]
text yadda
yadda
[100]
...
And want to filter the field that only the lines with [...] remain in the
field.

So I thought
...
filter fld 1 with "[*" 
...
would do the job, but that EMPTIES the field!?
Obviously this [ interferes with some REGEX mechanism of filter?
So what should I use now?

Any hints very appreciated!


Best

Klaus
--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-19 Thread Bob Sneidar via use-livecode
I don’t think I could watch! Oh the horror!

Bob S


> On Nov 19, 2020, at 9:17 AM, Keith Clarke via use-livecode 
>  wrote:
> 
> The chronicles of regex - a potential blockbuster there, Bob! :-)
> Best,
> Keith
> 
>> On 19 Nov 2020, at 16:49, Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> No one escapes the lair of the Regex Demon. Except for maybe Riddick.
>> 
>> Bob S
>> 
>> 
>> On Nov 19, 2020, at 8:15 AM, Keith Clarke via use-livecode 
>> mailto:use-livecode@lists.runrev.com>> wrote:
>> 
>> Ha, yes I understand that desire - and Mark’s one-character escape trick 
>> beats my hack to bypass the lair of the regex demon! :D
>> Best,
>> Keith
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-19 Thread Keith Clarke via use-livecode
The chronicles of regex - a potential blockbuster there, Bob! :-)
Best,
Keith

> On 19 Nov 2020, at 16:49, Bob Sneidar via use-livecode 
>  wrote:
> 
> No one escapes the lair of the Regex Demon. Except for maybe Riddick.
> 
> Bob S
> 
> 
> On Nov 19, 2020, at 8:15 AM, Keith Clarke via use-livecode 
> mailto:use-livecode@lists.runrev.com>> wrote:
> 
> Ha, yes I understand that desire - and Mark’s one-character escape trick 
> beats my hack to bypass the lair of the regex demon! :D
> Best,
> Keith
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-19 Thread Klaus major-k via use-livecode
Hi Mark,

> Am 19.11.2020 um 18:07 schrieb Mark Wieder via use-livecode 
> :
> On 11/19/20 7:38 AM, Mark Waddingham via use-livecode wrote:
>> I think:
>>   filter fld 1 with "[[]*"
>> Should do the trick...
> As an alternative,
> filter fld 1 with regex pattern "^\[+"
> also does the trick.

thanks, but REGEX is still a TAD over my head. ;-)

> -- 
> Mark Wieder
> ahsoftw...@gmail.com

Best

Klaus

--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-19 Thread Mark Wieder via use-livecode

On 11/19/20 7:38 AM, Mark Waddingham via use-livecode wrote:


I think:

   filter fld 1 with "[[]*"

Should do the trick...


As an alternative,

filter fld 1 with regex pattern "^\[+"

also does the trick.

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-19 Thread Bob Sneidar via use-livecode
No one escapes the lair of the Regex Demon. Except for maybe Riddick.

Bob S


On Nov 19, 2020, at 8:15 AM, Keith Clarke via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

Ha, yes I understand that desire - and Mark’s one-character escape trick beats 
my hack to bypass the lair of the regex demon! :D
Best,
Keith

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-19 Thread Keith Clarke via use-livecode
Ha, yes I understand that desire - and Mark’s one-character escape trick beats 
my hack to bypass the lair of the regex demon! :D
Best,
Keith

> On 19 Nov 2020, at 15:51, Klaus major-k via use-livecode 
>  wrote:
> 
> Hi Keith,
> 
>> Am 19.11.2020 um 16:38 schrieb Keith Clarke via use-livecode 
>> :
>> 
>> Hi Klaus,
>> Maybe iterate the lines - untested...
>> repeat for each line l in fld 1
>> if and( offset( “[“, l) > 0 , offset(“]”, l) > 0 ) then put line l of fld 1 
>> into tList
>> end repeat 
>> put tList
> 
> yes, sure, but "lazy moi" wanted to use FILTER and also understand why my 
> first script did not work. :-)
> 
>> Best,
>> Keith 
> 
> Best
> 
> Klaus
> 
> --
> Klaus Major
> https://www.major-k.de
> kl...@major-k.de
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-19 Thread Klaus major-k via use-livecode
Hi Keith,

> Am 19.11.2020 um 16:38 schrieb Keith Clarke via use-livecode 
> :
> 
> Hi Klaus,
> Maybe iterate the lines - untested...
> repeat for each line l in fld 1
>  if and( offset( “[“, l) > 0 , offset(“]”, l) > 0 ) then put line l of fld 1 
> into tList
> end repeat 
> put tList

yes, sure, but "lazy moi" wanted to use FILTER and also understand why my first 
script did not work. :-)

> Best,
> Keith 

Best

Klaus

--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-19 Thread Klaus major-k via use-livecode
Hi Mark,

> Am 19.11.2020 um 16:38 schrieb Mark Waddingham via use-livecode 
> :
> 
>> So I thought
>> ...
>> filter fld 1 with "[*"
>> ...
>> would do the job, but that EMPTIES the field!?
>> Obviously this [ interferes with some REGEX mechanism of filter?
>> So what should I use now?
> I think:
>  filter fld 1 with "[[]*"
> Should do the trick...
> Basically, you can use '[...]' to 'escape' the operators in the wildcard 
> pattern (i.e. *, [ and ?).

ah, get it! So I added this accordingly:
...
filter fld 1 with "[[]*[]]"
...
to be on the safe side and it works like a charme!

> Hope this helps,

Yes, it does, thank you very much!

> Mark.
> 
> P.S. Wildcard patterns are a lot simpler than general regexes, but 'filter' 
> can do both "filter ... with regex pattern ..." interprets the pattern the 
> same as matchText/replaceText.
> 
> -- 
> Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
> LiveCode: Everyone can create apps

Best

Klaus

--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-19 Thread Keith Clarke via use-livecode
Hi Klaus,
Maybe iterate the lines - untested...

repeat for each line l in fld 1
  if and( offset( “[“, l) > 0 , offset(“]”, l) > 0 ) then put line l of fld 1 
into tList
end repeat 

put tList

Best,
Keith 

> On 19 Nov 2020, at 15:19, Klaus major-k via use-livecode 
>  wrote:
> 
> Hi all,
> 
> I am surely missing something here with filter.
> 
> I have a field with some lines like:
> ...
> [500]
> text yadda
> yadda
> [100]
> ...
> And want to filter the field that only the lines with [...] remain in the 
> field.
> 
> So I thought
> ...
> filter fld 1 with "[*" 
> ...
> would do the job, but that EMPTIES the field!?
> Obviously this [ interferes with some REGEX mechanism of filter?
> So what should I use now?
> 
> Any hints very appreciated!
> 
> 
> Best
> 
> Klaus
> --
> Klaus Major
> https://www.major-k.de
> kl...@major-k.de
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter

2020-11-19 Thread Mark Waddingham via use-livecode

So I thought
...
filter fld 1 with "[*"
...
would do the job, but that EMPTIES the field!?
Obviously this [ interferes with some REGEX mechanism of filter?
So what should I use now?


I think:

  filter fld 1 with "[[]*"

Should do the trick...

Basically, you can use '[...]' to 'escape' the operators in the wildcard 
pattern (i.e. *, [ and ?).


Hope this helps,

Mark.

P.S. Wildcard patterns are a lot simpler than general regexes, but 
'filter' can do both "filter ... with regex pattern ..." interprets the 
pattern the same as matchText/replaceText.


--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-21 Thread J. Landman Gay via use-livecode
Mark Talluto's bug is exactly what I see. It may be related to a certain 
type of scripting, or a particular sequence of commands. I crashed several 
times in a row within a minute of a restart, so maybe the handler I was 
debugging was to blame.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On June 21, 2019 5:32:26 PM Bob Sneidar via use-livecode 
 wrote:


I am using V9.0.5 rc1 and I am not having any of these kinds of debugging 
crashes. I rarely step over though. Almost always I step into or out of. (I 
think I have that right.)


Bob S

On Jun 21, 2019, at 14:33 , J. Landman Gay via use-livecode 
 wrote:


On 6/21/19 2:48 PM, Alex Tweedly via use-livecode wrote:

On 21/06/2019 19:38, J. Landman Gay via use-livecode wrote:
My only excuse is that I've been avoiding stepping through the debugger 
because LC has been crashing when I do that. I've sent in many crash logs 
but it's only recently I've discovered it happens only with Step Over. It's 
hard to believe no one else has seen this, which I've been seeing since LC 
9 first came out, but that's why I didn't know what was in the variable.
I've been seeing this too. But it's time to confess my abysmal ignorance - 
how do I get a crash log ?


On Mac, a huge dialog appears with the crash log in it. I select all, copy, 
paste into a text document and save it. On Windows I don't know, but if 
there's a system log (like Console displays on Mac) it's probably in there.



(And is it worthwhile me getting some of them to add to the bug reports?)


Good question. I've uploaded maybe 20-25 of them so far. I don't always 
bother any more.


Now that I've discovered breakpoints don't crash as long as I don't step 
through, I was able to see what's going on.


I was wrong. Not more than a few minutes ago I crashed after stopping at 
multiple breakpoints. It doesn't seem to matter if they're red-dot or 
typed. However, it seems to take more repetitions before the crash if you 
don't do any stepping.


Hmmm - I find I have no choice but to step through; the editor/debugger so 
often "freezes" (i.e. when I scroll the text, the line numbers don't scroll 
at the same time).


I see that all the time. If you step over, the dot location fixes itself at 
least here. Until the crash, anyway. It doesn't crash right away, it seems 
to be a cumulative thing, so you get a few chances before everything goes down.


This has really been crippling my productivity. I'm sure it's a very 
elusive thing to track down but I hope they can find it. If no one else has 
a problem, it may be something script-related that both you and I are doing.



So I can't just set another breakpoint further down - I have to step over 
for a while until the place at which I want to set the breakpoint scrolls 
itself into view.


If you have experienced crashes during debugging, take a look at 
https://quality.livecode.com/show_bug.cgi?id=22130 and 
https://quality.livecode.com/show_bug.cgi?id=21876



Alex.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode



--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-21 Thread Bob Sneidar via use-livecode
I am using V9.0.5 rc1 and I am not having any of these kinds of debugging 
crashes. I rarely step over though. Almost always I step into or out of. (I 
think I have that right.) 

Bob S

> On Jun 21, 2019, at 14:33 , J. Landman Gay via use-livecode 
>  wrote:
> 
> On 6/21/19 2:48 PM, Alex Tweedly via use-livecode wrote:
>> On 21/06/2019 19:38, J. Landman Gay via use-livecode wrote:
>>> My only excuse is that I've been avoiding stepping through the debugger 
>>> because LC has been crashing when I do that. I've sent in many crash logs 
>>> but it's only recently I've discovered it happens only with Step Over. It's 
>>> hard to believe no one else has seen this, which I've been seeing since LC 
>>> 9 first came out, but that's why I didn't know what was in the variable.
>> I've been seeing this too. But it's time to confess my abysmal ignorance - 
>> how do I get a crash log ?
> 
> On Mac, a huge dialog appears with the crash log in it. I select all, copy, 
> paste into a text document and save it. On Windows I don't know, but if 
> there's a system log (like Console displays on Mac) it's probably in there.
> 
>> (And is it worthwhile me getting some of them to add to the bug reports?)
> 
> Good question. I've uploaded maybe 20-25 of them so far. I don't always 
> bother any more.
> 
>>> Now that I've discovered breakpoints don't crash as long as I don't step 
>>> through, I was able to see what's going on.
> 
> I was wrong. Not more than a few minutes ago I crashed after stopping at 
> multiple breakpoints. It doesn't seem to matter if they're red-dot or typed. 
> However, it seems to take more repetitions before the crash if you don't do 
> any stepping.
> 
>> Hmmm - I find I have no choice but to step through; the editor/debugger so 
>> often "freezes" (i.e. when I scroll the text, the line numbers don't scroll 
>> at the same time).
> 
> I see that all the time. If you step over, the dot location fixes itself at 
> least here. Until the crash, anyway. It doesn't crash right away, it seems to 
> be a cumulative thing, so you get a few chances before everything goes down.
> 
> This has really been crippling my productivity. I'm sure it's a very elusive 
> thing to track down but I hope they can find it. If no one else has a 
> problem, it may be something script-related that both you and I are doing.
> 
> 
>> So I can't just set another breakpoint further down - I have to step over 
>> for a while until the place at which I want to set the breakpoint scrolls 
>> itself into view.
>>> 
>>> If you have experienced crashes during debugging, take a look at 
>>> https://quality.livecode.com/show_bug.cgi?id=22130 and 
>>> https://quality.livecode.com/show_bug.cgi?id=21876
>>> 
>> Alex.
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-21 Thread Mark Talluto via use-livecode
On Jun 21, 2019, at 2:33 PM, J. Landman Gay via use-livecode 
 wrote:
> 
> I see that all the time. If you step over, the dot location fixes itself at 
> least here. Until the crash, anyway. It doesn't crash right away, it seems to 
> be a cumulative thing, so you get a few chances before everything goes down.
> 
> This has really been crippling my productivity. I'm sure it's a very elusive 
> thing to track down but I hope they can find it. If no one else has a 
> problem, it may be something script-related that both you and I are doing.


I have this problem too. I think it has been around for a very long time. I 
have a bug report for it as well.
https://quality.livecode.com/show_bug.cgi?id=22101 



Best regards,

Mark Talluto
livecloud.io 
nursenotes.net 
canelasoftware.com 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-21 Thread J. Landman Gay via use-livecode

On 6/21/19 2:48 PM, Alex Tweedly via use-livecode wrote:


On 21/06/2019 19:38, J. Landman Gay via use-livecode wrote:
My only excuse is that I've been avoiding stepping through the 
debugger because LC has been crashing when I do that. I've sent in 
many crash logs but it's only recently I've discovered it happens only 
with Step Over. It's hard to believe no one else has seen this, which 
I've been seeing since LC 9 first came out, but that's why I didn't 
know what was in the variable.


I've been seeing this too. But it's time to confess my abysmal ignorance 
- how do I get a crash log ?


On Mac, a huge dialog appears with the crash log in it. I select all, 
copy, paste into a text document and save it. On Windows I don't know, 
but if there's a system log (like Console displays on Mac) it's probably 
in there.




(And is it worthwhile me getting some of them to add to the bug reports?)


Good question. I've uploaded maybe 20-25 of them so far. I don't always 
bother any more.




Now that I've discovered breakpoints don't crash as long as I don't 
step through, I was able to see what's going on.


I was wrong. Not more than a few minutes ago I crashed after stopping at 
multiple breakpoints. It doesn't seem to matter if they're red-dot or 
typed. However, it seems to take more repetitions before the crash if 
you don't do any stepping.


Hmmm - I find I have no choice but to step through; the editor/debugger 
so often "freezes" (i.e. when I scroll the text, the line numbers don't 
scroll at the same time).


I see that all the time. If you step over, the dot location fixes itself 
at least here. Until the crash, anyway. It doesn't crash right away, it 
seems to be a cumulative thing, so you get a few chances before 
everything goes down.


This has really been crippling my productivity. I'm sure it's a very 
elusive thing to track down but I hope they can find it. If no one else 
has a problem, it may be something script-related that both you and I 
are doing.



So I can't just set another breakpoint further 
down - I have to step over for a while until the place at which I want 
to set the breakpoint scrolls itself into view.


If you have experienced crashes during debugging, take a look at 
https://quality.livecode.com/show_bug.cgi?id=22130 and 
https://quality.livecode.com/show_bug.cgi?id=21876



Alex.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode




--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-21 Thread Bob Sneidar via use-livecode
Yes it is in memory, but it makes me think there might be a use case for 
allowing the creation of a file based database. I'll update it and repost on 
the list. 

Bob S


> On Jun 21, 2019, at 12:57 , Tom Glod via use-livecode 
>  wrote:
> 
> very good thanks for elaborating Bob...it makes sense that there are
> use cases where the library really kicks it.. esp since its an in
> memory database (assuming).  Its a good idea, making me rethink a couple of
> things.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-21 Thread Tom Glod via use-livecode
very good thanks for elaborating Bob...it makes sense that there are
use cases where the library really kicks it.. esp since its an in
memory database (assuming).  Its a good idea, making me rethink a couple of
things.

On Fri, Jun 21, 2019 at 12:06 PM Alex Tweedly via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Bob,
>
> It sounds like your library is something I could benefit from :-)
>
> I know it's been mentioned on the list before, but I've lost track of
> where to get it from, and  a quick search didn't turn anything up. Could
> you please send a reminder (either to the list or direct to me if you
> prefer).
>
> Thanks
>
> Alex.
>
> On 21/06/2019 16:02, Bob Sneidar via use-livecode wrote:
> > Hi Tom.
> >
> > So the little benchmarking I did originally showed that my method was a
> little longer, as I still have to iterate once through the array to
> populate the database. Where it really shines is that you can do complex
> queries, as well as multiple column sorts before converting back to an
> array. Also, if you need to make multiple passes at the data, the speed of
> course exceeds iterating through the array again and again. Finally, since
> it's in a database, it's persistent through idle, whereas an array would
> have to be stored in a script local or a property if you needed it across
> runtime sessions.
> >
> > Bob S
> >
> >
> >> On Jun 20, 2019, at 21:10 , Tom Glod via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>
> >> A great question Jacque Helpful thread all around.
> >>
> >> I have a tendency to think that any operation i perform to convert an
> >> entire array into something else will take longer than to loop through
> the
> >> keys.  I'm happy to be wrong ,and I imagine it depends on the number of
> >> items in the dataset. But for my particular use at the moment, I find LC
> >> performance to be excellent.
> >>
> >> Bob I'm interested in your library..mostly learning the point at
> which
> >> it makes sense to do that conversion and what kind of speedups can
> >> occur.have you done any benchmarks on it?
> >>
> >> Great reminder & idea Monte
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-21 Thread Alex Tweedly via use-livecode



On 21/06/2019 19:38, J. Landman Gay via use-livecode wrote:
My only excuse is that I've been avoiding stepping through the 
debugger because LC has been crashing when I do that. I've sent in 
many crash logs but it's only recently I've discovered it happens only 
with Step Over. It's hard to believe no one else has seen this, which 
I've been seeing since LC 9 first came out, but that's why I didn't 
know what was in the variable.


I've been seeing this too. But it's time to confess my abysmal ignorance 
- how do I get a crash log ?


(And is it worthwhile me getting some of them to add to the bug reports?)

Now that I've discovered breakpoints don't crash as long as I don't 
step through, I was able to see what's going on.
Hmmm - I find I have no choice but to step through; the editor/debugger 
so often "freezes" (i.e. when I scroll the text, the line numbers don't 
scroll at the same time). So I can't just set another breakpoint further 
down - I have to step over for a while until the place at which I want 
to set the breakpoint scrolls itself into view.


If you have experienced crashes during debugging, take a look at 
https://quality.livecode.com/show_bug.cgi?id=22130 and 
https://quality.livecode.com/show_bug.cgi?id=21876



Alex.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-21 Thread J. Landman Gay via use-livecode
Found the problem. My script local was being emptied for some reason, so 
there was nothing to filter. After repopulating all data it worked.


My only excuse is that I've been avoiding stepping through the debugger 
because LC has been crashing when I do that. I've sent in many crash 
logs but it's only recently I've discovered it happens only with Step 
Over. It's hard to believe no one else has seen this, which I've been 
seeing since LC 9 first came out, but that's why I didn't know what was 
in the variable. Now that I've discovered breakpoints don't crash as 
long as I don't step through, I was able to see what's going on.


If you have experienced crashes during debugging, take a look at 
https://quality.livecode.com/show_bug.cgi?id=22130 and 
https://quality.livecode.com/show_bug.cgi?id=21876


I have several more in my collection that I haven't uploaded yet.

On 6/21/19 4:26 AM, Niggemann, Bernd via use-livecode wrote:


Am 21.06.2019 um 09:01 schrieb 
use-livecode-requ...@lists.runrev.com:

From: "J. Landman Gay"

I spoke too soon. When I tested, I hard-coded a value as the filter
string. But when I use a variable, it fails as it did before. The
elements of the array all start with a 4-character string followed by an
underscore, for example:  ER01_some text here

My variable contains "ER01":

   put tVar & "_*" into tFilter
   filter elements of sArray with tFilter into tNewArray

No go. I've tried a few different iterations. However, this works:

   filter elements of sArray with "ER01_*" into tNewArray


This works for me in 9.0.4 and 9.5 DP1


on mouseUp
local tErr = "ER01"
local tArray, tVar, tNewArray

put (tErr & "_*") into tVar

repeat with i = 1 to 17
   if i mod 2 is 1 then
  put tErr & "_" & i into tArray[i]
   else
  put i into tArray[i]
   end if
end repeat
breakpoint
filter elements of tArray with tVar into tNewArray
breakpoint
filter elements of tArray with tVar
breakpoint
end mouseUp


may be O <> zero?

Kind regards
Bernd


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-21 Thread Alex Tweedly via use-livecode

Hi Bob,

It sounds like your library is something I could benefit from :-)

I know it's been mentioned on the list before, but I've lost track of 
where to get it from, and  a quick search didn't turn anything up. Could 
you please send a reminder (either to the list or direct to me if you 
prefer).


Thanks

Alex.

On 21/06/2019 16:02, Bob Sneidar via use-livecode wrote:

Hi Tom.

So the little benchmarking I did originally showed that my method was a little 
longer, as I still have to iterate once through the array to populate the 
database. Where it really shines is that you can do complex queries, as well as 
multiple column sorts before converting back to an array. Also, if you need to 
make multiple passes at the data, the speed of course exceeds iterating through 
the array again and again. Finally, since it's in a database, it's persistent 
through idle, whereas an array would have to be stored in a script local or a 
property if you needed it across runtime sessions.

Bob S



On Jun 20, 2019, at 21:10 , Tom Glod via use-livecode 
 wrote:

A great question Jacque Helpful thread all around.

I have a tendency to think that any operation i perform to convert an
entire array into something else will take longer than to loop through the
keys.  I'm happy to be wrong ,and I imagine it depends on the number of
items in the dataset. But for my particular use at the moment, I find LC
performance to be excellent.

Bob I'm interested in your library..mostly learning the point at which
it makes sense to do that conversion and what kind of speedups can
occur.have you done any benchmarks on it?

Great reminder & idea Monte


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Filter an array by content

2019-06-21 Thread Bob Sneidar via use-livecode
Hi Tom. 

So the little benchmarking I did originally showed that my method was a little 
longer, as I still have to iterate once through the array to populate the 
database. Where it really shines is that you can do complex queries, as well as 
multiple column sorts before converting back to an array. Also, if you need to 
make multiple passes at the data, the speed of course exceeds iterating through 
the array again and again. Finally, since it's in a database, it's persistent 
through idle, whereas an array would have to be stored in a script local or a 
property if you needed it across runtime sessions. 

Bob S


> On Jun 20, 2019, at 21:10 , Tom Glod via use-livecode 
>  wrote:
> 
> A great question Jacque Helpful thread all around.
> 
> I have a tendency to think that any operation i perform to convert an
> entire array into something else will take longer than to loop through the
> keys.  I'm happy to be wrong ,and I imagine it depends on the number of
> items in the dataset. But for my particular use at the moment, I find LC
> performance to be excellent.
> 
> Bob I'm interested in your library..mostly learning the point at which
> it makes sense to do that conversion and what kind of speedups can
> occur.have you done any benchmarks on it?
> 
> Great reminder & idea Monte


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-21 Thread Dar Scott Consulting via use-livecode
I wonder whether explicitly specifying "wildcard pattern" would fix this.

(I misread your query as referring to arrays with numeric elements, not arrays 
with numeric keys. Thus, my fascination with the new "where" where one can use 
"each > 22.2". Even with your use, "where" might be interesting.)

> On Jun 21, 2019, at 1:01 AM, J. Landman Gay via use-livecode 
>  wrote:
> 
> I spoke too soon. When I tested, I hard-coded a value as the filter string. 
> But when I use a variable, it fails as it did before. The elements of the 
> array all start with a 4-character string followed by an underscore, for 
> example:  ER01_some text here
> 
> My variable contains "ER01":
> 
>  put tVar & "_*" into tFilter
>  filter elements of sArray with tFilter into tNewArray
> 
> No go. I've tried a few different iterations. However, this works:
> 
>  filter elements of sArray with "ER01_*" into tNewArray
> 
> Even with no matches though, Tom was right. Looping through the keys takes 
> 0.03 milliseconds. Filtering takes 0.22 ms.
> 
> On 6/21/19 1:38 AM, J. Landman Gay via use-livecode wrote:
>> Thanks to all for the replies. Monte, I didn't see your post until Tom 
>> quoted it, for some reason it didn't arrive here.
>> At any rate, I'd already tried "filter elements of..." and it failed which 
>> is why I posted. But I must have had my filter wrong because I just tried it 
>> again and it worked. So that part's solved.
>> And I found something interesting: when I filter a numeric array, the keys 
>> remain attached and since they are numeric, they're in order. Fancy that. :)
>> All is well. Thanks guys.
>> On 6/20/19 11:10 PM, Tom Glod via use-livecode wrote:
>>> A great question Jacque Helpful thread all around.
> 
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-21 Thread Niggemann, Bernd via use-livecode


Am 21.06.2019 um 09:01 schrieb 
use-livecode-requ...@lists.runrev.com:

From: "J. Landman Gay"

I spoke too soon. When I tested, I hard-coded a value as the filter
string. But when I use a variable, it fails as it did before. The
elements of the array all start with a 4-character string followed by an
underscore, for example:  ER01_some text here

My variable contains "ER01":

  put tVar & "_*" into tFilter
  filter elements of sArray with tFilter into tNewArray

No go. I've tried a few different iterations. However, this works:

  filter elements of sArray with "ER01_*" into tNewArray


This works for me in 9.0.4 and 9.5 DP1


on mouseUp
   local tErr = "ER01"
   local tArray, tVar, tNewArray

   put (tErr & "_*") into tVar

   repeat with i = 1 to 17
  if i mod 2 is 1 then
 put tErr & "_" & i into tArray[i]
  else
 put i into tArray[i]
  end if
   end repeat
   breakpoint
   filter elements of tArray with tVar into tNewArray
   breakpoint
   filter elements of tArray with tVar
   breakpoint
end mouseUp


may be O <> zero?

Kind regards
Bernd


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-21 Thread J. Landman Gay via use-livecode
I spoke too soon. When I tested, I hard-coded a value as the filter 
string. But when I use a variable, it fails as it did before. The 
elements of the array all start with a 4-character string followed by an 
underscore, for example:  ER01_some text here


My variable contains "ER01":

  put tVar & "_*" into tFilter
  filter elements of sArray with tFilter into tNewArray

No go. I've tried a few different iterations. However, this works:

  filter elements of sArray with "ER01_*" into tNewArray

Even with no matches though, Tom was right. Looping through the keys 
takes 0.03 milliseconds. Filtering takes 0.22 ms.


On 6/21/19 1:38 AM, J. Landman Gay via use-livecode wrote:
Thanks to all for the replies. Monte, I didn't see your post until Tom 
quoted it, for some reason it didn't arrive here.


At any rate, I'd already tried "filter elements of..." and it failed 
which is why I posted. But I must have had my filter wrong because I 
just tried it again and it worked. So that part's solved.


And I found something interesting: when I filter a numeric array, the 
keys remain attached and since they are numeric, they're in order. Fancy 
that. :)


All is well. Thanks guys.

On 6/20/19 11:10 PM, Tom Glod via use-livecode wrote:

A great question Jacque Helpful thread all around.






--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-21 Thread J. Landman Gay via use-livecode
Thanks to all for the replies. Monte, I didn't see your post until Tom 
quoted it, for some reason it didn't arrive here.


At any rate, I'd already tried "filter elements of..." and it failed 
which is why I posted. But I must have had my filter wrong because I 
just tried it again and it worked. So that part's solved.


And I found something interesting: when I filter a numeric array, the 
keys remain attached and since they are numeric, they're in order. Fancy 
that. :)


All is well. Thanks guys.

On 6/20/19 11:10 PM, Tom Glod via use-livecode wrote:

A great question Jacque Helpful thread all around.



--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-20 Thread Tom Glod via use-livecode
A great question Jacque Helpful thread all around.

I have a tendency to think that any operation i perform to convert an
entire array into something else will take longer than to loop through the
keys.  I'm happy to be wrong ,and I imagine it depends on the number of
items in the dataset. But for my particular use at the moment, I find LC
performance to be excellent.

Bob I'm interested in your library..mostly learning the point at which
it makes sense to do that conversion and what kind of speedups can
occur.have you done any benchmarks on it?

Great reminder & idea Monte

On Thu, Jun 20, 2019 at 6:19 PM Monte Goulding via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Jacque, does the output also need to be a sequential numeric array? If
> so then no variant of the filter command will help. If not then can’t you
> `filter elements of theArray with “*foobar*”``? It would be a nice addition
> to filter elements to have `as sequence` or something so the result had
> keys 1..N.
>
> > On 21 Jun 2019, at 6:56 am, J. Landman Gay via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > I need to filter a numeric array by the content of the keys, not by the
> keys themselves. Is there a way to do that without looping through the
> entire array and looking at each element?
> >
> > --
> > Jacqueline Landman Gay | jac...@hyperactivesw.com
> > HyperActive Software   | http://www.hyperactivesw.com
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Filter an array by content

2019-06-20 Thread Monte Goulding via use-livecode
Hi Jacque, does the output also need to be a sequential numeric array? If so 
then no variant of the filter command will help. If not then can’t you `filter 
elements of theArray with “*foobar*”``? It would be a nice addition to filter 
elements to have `as sequence` or something so the result had keys 1..N.

> On 21 Jun 2019, at 6:56 am, J. Landman Gay via use-livecode 
>  wrote:
> 
> I need to filter a numeric array by the content of the keys, not by the keys 
> themselves. Is there a way to do that without looping through the entire 
> array and looking at each element?
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Filter an array by content

2019-06-20 Thread Dar Scott Consulting via use-livecode
If LiveCode 9.5 is not applicable (since it is not released), then...

If those numbers are codes taken from some small universe of codes, then maybe 
intersect will work:
intersect affectedZipCodes with TreatedZipCodes into inspectionZipCodes


But if you can go with 9.5, then maybe "where" will work:
filter elements of testDistance where each > 20.5 into failedDistance



> On Jun 20, 2019, at 2:56 PM, J. Landman Gay via use-livecode 
>  wrote:
> 
> I need to filter a numeric array by the content of the keys, not by the keys 
> themselves. Is there a way to do that without looping through the entire 
> array and looking at each element?
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-20 Thread Dar Scott Consulting via use-livecode
I think the filtering of array items was introduced in 8.1, so combine and 
split might not be needed. However, unless pattern matching will do, one has to 
wait until 9.5 to use the "where" clause in "filter".

> On Jun 20, 2019, at 3:37 PM, hh via use-livecode 
>  wrote:
> 
> Why not "combine array V > filter V > split V"?
> 
>> JLG wrote:
>> I need to filter a numeric array by the content of the keys, not by the 
>> keys themselves. Is there a way to do that without looping through the 
>> entire array and looking at each element?
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-20 Thread Bob Sneidar via use-livecode
You would have to also sort. Also, the array might not be sorted after the 
split. 

Bob S


> On Jun 20, 2019, at 14:37 , hh via use-livecode 
>  wrote:
> 
> Why not "combine array V > filter V > split V"?
> 
>> JLG wrote:
>> I need to filter a numeric array by the content of the keys, not by the 
>> keys themselves. Is there a way to do that without looping through the 
>> entire array and looking at each element?


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-20 Thread hh via use-livecode
Why not "combine array V > filter V > split V"?

> JLG wrote:
> I need to filter a numeric array by the content of the keys, not by the 
> keys themselves. Is there a way to do that without looping through the 
> entire array and looking at each element?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-20 Thread Bob Sneidar via use-livecode
This is the perfect scenario for my arrayToDB library. Convert array to sqLite 
DB, query the DB using SELECT * from  WHERE  ORDER 
BY CAST( AS  decimal(10.2)) then convert the resulting cursor back to 
an array. Contact me offlist if interested. 

Bob S


> On Jun 20, 2019, at 13:56 , J. Landman Gay via use-livecode 
>  wrote:
> 
> I need to filter a numeric array by the content of the keys, not by the keys 
> themselves. Is there a way to do that without looping through the entire 
> array and looking at each element?
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter an array by content

2019-06-20 Thread Dar Scott Consulting via use-livecode
In 9.5, perhaps,
filter ... where 
will do it.

> On Jun 20, 2019, at 2:56 PM, J. Landman Gay via use-livecode 
>  wrote:
> 
> I need to filter a numeric array by the content of the keys, not by the keys 
> themselves. Is there a way to do that without looping through the entire 
> array and looking at each element?
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: filter list_of_files with REGEX xyz?

2018-08-17 Thread Ralph DiMola via use-livecode
Let them eat cake.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Bob Sneidar via use-livecode
Sent: Friday, August 17, 2018 4:39 PM
To: How to use LiveCode
Cc: Bob Sneidar
Subject: Re: filter list_of_files with REGEX xyz?

Half want cake, the other half, pie. 

Bob S


> On Aug 17, 2018, at 09:45 , Mark Wieder via use-livecode
 wrote:
> 
> On 08/17/2018 08:54 AM, Ralph DiMola via use-livecode wrote:
>> True true... I thought about it but left it as is just in case there 
>> was an image without a file name before the ".". I did not want it to be
missed.
>> You know users...
> 
> LOL
> 
> --
> Mark Wieder
> ahsoftw...@gmail.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter list_of_files with REGEX xyz?

2018-08-17 Thread Bob Sneidar via use-livecode
Half want cake, the other half, pie. 

Bob S


> On Aug 17, 2018, at 09:45 , Mark Wieder via use-livecode 
>  wrote:
> 
> On 08/17/2018 08:54 AM, Ralph DiMola via use-livecode wrote:
>> True true... I thought about it but left it as is just in case there was an
>> image without a file name before the ".". I did not want it to be missed.
>> You know users...
> 
> LOL
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter list_of_files with REGEX xyz?

2018-08-17 Thread Mark Wieder via use-livecode

On 08/17/2018 08:54 AM, Ralph DiMola via use-livecode wrote:

True true... I thought about it but left it as is just in case there was an
image without a file name before the ".". I did not want it to be missed.
You know users...


LOL

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: filter list_of_files with REGEX xyz?

2018-08-17 Thread Ralph DiMola via use-livecode
True true... I thought about it but left it as is just in case there was an
image without a file name before the ".". I did not want it to be missed.
You know users...

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Mark Wieder via use-livecode
Sent: Friday, August 17, 2018 11:41 AM
To: Ralph DiMola via use-livecode
Cc: Mark Wieder
Subject: Re: filter list_of_files with REGEX xyz?

On 08/17/2018 07:13 AM, Ralph DiMola via use-livecode wrote:
> filter tList with regex pattern "(?i).*\.(jpe?g|png|gif)$"

For a file list that should probably be

filter tList with regex pattern "(?i).+\.(jpe?g|png|gif)$"

unless you explicitly want to see file names that start with "."

-- 
  Mark Wieder
  ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter list_of_files with REGEX xyz?

2018-08-17 Thread Mark Wieder via use-livecode

On 08/17/2018 07:13 AM, Ralph DiMola via use-livecode wrote:

filter tList with regex pattern "(?i).*\.(jpe?g|png|gif)$"


For a file list that should probably be

filter tList with regex pattern "(?i).+\.(jpe?g|png|gif)$"

unless you explicitly want to see file names that start with "."

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter list_of_files with REGEX xyz?

2018-08-17 Thread Lagi Pittas via use-livecode
I was going to send the whole line but Hermann has beaten me to it - and I
will use his version from now on, thanks Hermann.

Lagi


On Fri, 17 Aug 2018 at 15:03, Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Hermann,
>
> > Am 17.08.2018 um 15:58 schrieb hh via use-livecode <
> use-livecode@lists.runrev.com>:
> >
> > This is already case-insensitive, but the period needs an escape:
> >
> > filter tList with regex pattern "\.*(jpe?g|png|gif)$"
>
> ah, jetzt ja! :-)
> Thanks a lot!
>
> Best
>
> Klaus
>
> --
> Klaus Major
> http://www.major-k.de
> kl...@major-k.de
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter list_of_files with REGEX xyz?

2018-08-17 Thread Lagi Pittas via use-livecode
I used (without the gif)

.*\.jpj|jpeg|png|gif

The above is not case sensitive  - just tested it

Lagi

On Fri, 17 Aug 2018 at 14:45, Ralph DiMola via use-livecode <
use-livecode@lists.runrev.com> wrote:

> (?i) turn off case sensitivity for everything after it in the regex
> expression. (?-i) turns it back on again for everything after it.
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
>
>
> -Original Message-
> From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On
> Behalf Of Brian Milby via use-livecode
> Sent: Friday, August 17, 2018 9:19 AM
> To: How to use LiveCode
> Cc: Brian Milby
> Subject: Re: filter list_of_files with REGEX xyz?
>
> RegEx pattern
> Sorry, I was just giving the pattern, not the syntax.
> Also, it will probably be case sensitive in that format. I won’t be able
> to test until later. I don’t recall the case insensitive flag off hand.
>
> Thanks,
> Brian
> On Aug 17, 2018, 8:15 AM -0500, Klaus major-k via use-livecode <
> use-livecode@lists.runrev.com>, wrote:
> > Hi Brian,
> >
> > > Am 17.08.2018 um 14:40 schrieb Brian Milby via use-livecode <
> use-livecode@lists.runrev.com>:
> > >
> > > Pattern “*.(jpe?g|png|gif)”
> >
> > thanks, but that does not work!?
> >
> > I tried:
> > on mouseUp pMouseButton
> > answer folder "sdsdsdsd"
> > put it into tFolder
> > put files(tFolder) into tList
> > filter tList with pattern "*.(jpe?g|png|gif)"
> > answer tList
> > end mouseUp
> >
> > tList = EMPTY, I made of course sure there are JPG, PNG and GIF files in
> that folder.
> >
> > Same when I use:
> > ...
> > filter lines of tList with pattern "*.(jpe?g|png|gif)"
> > ...
> > Any clues?
> >
> > > Thanks,
> >
> > You're welcome! :-)
> >
> > > Brian
> > > On Aug 17, 2018, 6:44 AM -0500, Klaus major-k via use-livecode <
> use-livecode@lists.runrev.com>, wrote:
> > > > Hi friends,
> > > >
> > > > I know how to:
> > > > ...
> > > > filter list_of_files with "*.jpg"
> > > > ...
> > > > But REGEX stuff is way over my head. :-/ Can anyone provide the
> > > > regex/pattern syntax for filtering jpg, png etc. in ONE run? Know
> > > > what I mean?
> >
> > Best
> >
> > Klaus
> >
> > --
> > Klaus Major
> > http://www.major-k.de
> > kl...@major-k.de
> >
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

RE: filter list_of_files with REGEX xyz?

2018-08-17 Thread Ralph DiMola via use-livecode
The ".*" is the wild card(zero or more) and "\." Is the period.

filter tList with regex pattern "(?i).*\.(jpe?g|png|gif)$"

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of hh via use-livecode
Sent: Friday, August 17, 2018 9:58 AM
To: use-livecode@lists.runrev.com
Cc: hh
Subject: Re: filter list_of_files with REGEX xyz?

This is already case-insensitive, but the period needs an escape:

filter tList with regex pattern "\.*(jpe?g|png|gif)$"


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: filter list_of_files with REGEX xyz?

2018-08-17 Thread Brian Milby via use-livecode
Let’s try this again...
Regex pattern “.*\.(jpe?g|png)$”

. - any character
* - any number of previous match term
? - 0 or 1 of previous term
\. - escapes the period for literal match
() - groups terms
| - alternates within group
$ - end of line

Thanks,
Brian
On Aug 17, 2018, 8:45 AM -0500, Ralph DiMola via use-livecode 
, wrote:
> (?i) turn off case sensitivity for everything after it in the regex 
> expression. (?-i) turns it back on again for everything after it.
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
>
>
> -Original Message-
> From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf 
> Of Brian Milby via use-livecode
> Sent: Friday, August 17, 2018 9:19 AM
> To: How to use LiveCode
> Cc: Brian Milby
> Subject: Re: filter list_of_files with REGEX xyz?
>
> RegEx pattern
> Sorry, I was just giving the pattern, not the syntax.
> Also, it will probably be case sensitive in that format. I won’t be able to 
> test until later. I don’t recall the case insensitive flag off hand.
>
> Thanks,
> Brian
> On Aug 17, 2018, 8:15 AM -0500, Klaus major-k via use-livecode 
> , wrote:
> > Hi Brian,
> >
> > > Am 17.08.2018 um 14:40 schrieb Brian Milby via use-livecode 
> > > :
> > >
> > > Pattern “*.(jpe?g|png|gif)”
> >
> > thanks, but that does not work!?
> >
> > I tried:
> > on mouseUp pMouseButton
> > answer folder "sdsdsdsd"
> > put it into tFolder
> > put files(tFolder) into tList
> > filter tList with pattern "*.(jpe?g|png|gif)"
> > answer tList
> > end mouseUp
> >
> > tList = EMPTY, I made of course sure there are JPG, PNG and GIF files in 
> > that folder.
> >
> > Same when I use:
> > ...
> > filter lines of tList with pattern "*.(jpe?g|png|gif)"
> > ...
> > Any clues?
> >
> > > Thanks,
> >
> > You're welcome! :-)
> >
> > > Brian
> > > On Aug 17, 2018, 6:44 AM -0500, Klaus major-k via use-livecode 
> > > , wrote:
> > > > Hi friends,
> > > >
> > > > I know how to:
> > > > ...
> > > > filter list_of_files with "*.jpg"
> > > > ...
> > > > But REGEX stuff is way over my head. :-/ Can anyone provide the
> > > > regex/pattern syntax for filtering jpg, png etc. in ONE run? Know
> > > > what I mean?
> >
> > Best
> >
> > Klaus
> >
> > --
> > Klaus Major
> > http://www.major-k.de
> > kl...@major-k.de
> >
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your 
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter list_of_files with REGEX xyz?

2018-08-17 Thread Klaus major-k via use-livecode
Hi Hermann,

> Am 17.08.2018 um 15:58 schrieb hh via use-livecode 
> :
> 
> This is already case-insensitive, but the period needs an escape:
> 
> filter tList with regex pattern "\.*(jpe?g|png|gif)$"

ah, jetzt ja! :-)
Thanks a lot!

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter list_of_files with REGEX xyz?

2018-08-17 Thread hh via use-livecode
This is already case-insensitive, but the period needs an escape:

filter tList with regex pattern "\.*(jpe?g|png|gif)$"


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: filter list_of_files with REGEX xyz?

2018-08-17 Thread Ralph DiMola via use-livecode
(?i) turn off case sensitivity for everything after it in the regex expression. 
(?-i) turns it back on again for everything after it.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of 
Brian Milby via use-livecode
Sent: Friday, August 17, 2018 9:19 AM
To: How to use LiveCode
Cc: Brian Milby
Subject: Re: filter list_of_files with REGEX xyz?

RegEx pattern
Sorry, I was just giving the pattern, not the syntax.
Also, it will probably be case sensitive in that format. I won’t be able to 
test until later. I don’t recall the case insensitive flag off hand.

Thanks,
Brian
On Aug 17, 2018, 8:15 AM -0500, Klaus major-k via use-livecode 
, wrote:
> Hi Brian,
>
> > Am 17.08.2018 um 14:40 schrieb Brian Milby via use-livecode 
> > :
> >
> > Pattern “*.(jpe?g|png|gif)”
>
> thanks, but that does not work!?
>
> I tried:
> on mouseUp pMouseButton
> answer folder "sdsdsdsd"
> put it into tFolder
> put files(tFolder) into tList
> filter tList with pattern "*.(jpe?g|png|gif)"
> answer tList
> end mouseUp
>
> tList = EMPTY, I made of course sure there are JPG, PNG and GIF files in that 
> folder.
>
> Same when I use:
> ...
> filter lines of tList with pattern "*.(jpe?g|png|gif)"
> ...
> Any clues?
>
> > Thanks,
>
> You're welcome! :-)
>
> > Brian
> > On Aug 17, 2018, 6:44 AM -0500, Klaus major-k via use-livecode 
> > , wrote:
> > > Hi friends,
> > >
> > > I know how to:
> > > ...
> > > filter list_of_files with "*.jpg"
> > > ...
> > > But REGEX stuff is way over my head. :-/ Can anyone provide the 
> > > regex/pattern syntax for filtering jpg, png etc. in ONE run? Know 
> > > what I mean?
>
> Best
>
> Klaus
>
> --
> Klaus Major
> http://www.major-k.de
> kl...@major-k.de
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter list_of_files with REGEX xyz?

2018-08-17 Thread Klaus major-k via use-livecode
Hi Brian,

> Am 17.08.2018 um 15:19 schrieb Brian Milby via use-livecode 
> :
> 
> RegEx pattern
> Sorry, I was just giving the pattern, not the syntax.
> Also, it will probably be case sensitive in that format.

My suffixes are all lower case, so this shouldn't matter here.

> I won’t be able to test until later. I don’t recall the case insensitive flag 
> off hand.

No joy :-/

If I use:
...
filter tList with regex pattern "*.(jpe?g|png|gif)"
...
or
...
filter lines of tList with regex pattern "*.(jpe?g|png|gif)"
...
I get an error: 
button "Button": execution error at line 8 (matchChunk: error in pattern 
expression), char 1

> Thanks,
> Brian

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter list_of_files with REGEX xyz?

2018-08-17 Thread Brian Milby via use-livecode
RegEx pattern
Sorry, I was just giving the pattern, not the syntax.
Also, it will probably be case sensitive in that format. I won’t be able to 
test until later. I don’t recall the case insensitive flag off hand.

Thanks,
Brian
On Aug 17, 2018, 8:15 AM -0500, Klaus major-k via use-livecode 
, wrote:
> Hi Brian,
>
> > Am 17.08.2018 um 14:40 schrieb Brian Milby via use-livecode 
> > :
> >
> > Pattern “*.(jpe?g|png|gif)”
>
> thanks, but that does not work!?
>
> I tried:
> on mouseUp pMouseButton
> answer folder "sdsdsdsd"
> put it into tFolder
> put files(tFolder) into tList
> filter tList with pattern "*.(jpe?g|png|gif)"
> answer tList
> end mouseUp
>
> tList = EMPTY, I made of course sure there are JPG, PNG and GIF files in that 
> folder.
>
> Same when I use:
> ...
> filter lines of tList with pattern "*.(jpe?g|png|gif)"
> ...
> Any clues?
>
> > Thanks,
>
> You're welcome! :-)
>
> > Brian
> > On Aug 17, 2018, 6:44 AM -0500, Klaus major-k via use-livecode 
> > , wrote:
> > > Hi friends,
> > >
> > > I know how to:
> > > ...
> > > filter list_of_files with "*.jpg"
> > > ...
> > > But REGEX stuff is way over my head. :-/
> > > Can anyone provide the regex/pattern syntax for filtering
> > > jpg, png etc. in ONE run? Know what I mean?
>
> Best
>
> Klaus
>
> --
> Klaus Major
> http://www.major-k.de
> kl...@major-k.de
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter list_of_files with REGEX xyz?

2018-08-17 Thread Klaus major-k via use-livecode
Hi Brian,

> Am 17.08.2018 um 14:40 schrieb Brian Milby via use-livecode 
> :
> 
> Pattern “*.(jpe?g|png|gif)”

thanks, but that does not work!?

I tried:
on mouseUp pMouseButton
 answer folder "sdsdsdsd"
 put it into tFolder
 put files(tFolder) into tList
 filter tList with pattern "*.(jpe?g|png|gif)"
 answer tList
end mouseUp

tList = EMPTY, I made of course sure there are JPG, PNG and GIF files in that 
folder.

Same when I use:
...
filter lines of tList with pattern "*.(jpe?g|png|gif)"
...
Any clues?

> Thanks,

You're welcome! :-)

> Brian
> On Aug 17, 2018, 6:44 AM -0500, Klaus major-k via use-livecode 
> , wrote:
>> Hi friends,
>> 
>> I know how to:
>> ...
>> filter list_of_files with "*.jpg"
>> ...
>> But REGEX stuff is way over my head. :-/
>> Can anyone provide the regex/pattern syntax for filtering
>> jpg, png etc. in ONE run? Know what I mean?

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter list_of_files with REGEX xyz?

2018-08-17 Thread Brian Milby via use-livecode
Pattern “*.(jpe?g|png|gif)”

Thanks,
Brian
On Aug 17, 2018, 6:44 AM -0500, Klaus major-k via use-livecode 
, wrote:
> Hi friends,
>
> I know how to:
> ...
> filter list_of_files with "*.jpg"
> ...
> But REGEX stuff is way over my head. :-/
>
> Can anyone provide the regex/pattern syntax for filtering
> jpg, png etc. in ONE run? Know what I mean?
>
> Thanks a lot in advance!
>
>
> Best
>
> Klaus
> --
> Klaus Major
> http://www.major-k.de
> kl...@major-k.de
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-19 Thread Thierry Douez via use-livecode
​

Is there life without internet for one week?

- lucky you are connected to the world again!
> Tiemo
>

​Hallo Tiemo,

Except some hurdles with the administration ( sold my old car and bought a
new one) plus being insulted by a couple of stressed and egotist people for
not answering sooner,
I did use this time to clean my garden,
did some house construction and enjoyed
to talk longer with friends in the city :)

But I'll have to work all the week-end now :)

Kind regards,

Thierry
​

> >
> >> put "1 [A] 2 [B] 3." into tText
> >> put  removeBrackets( tText)
> >>
> >
> > I see that the middle section is omitted with my regex, so I forgot to
> > make it non-greedy. But I've forgotten how to do that, something about
> > a question mark, I think?
>
>
> ​Sorry about the delay, we had a thunderstorm which broke all Internet
> network in our area since last Friday.
>
> You can do this in 2 ways:
>
> - make your .* non greedy by adding a '?' suffix
>
> - or modify your regex this way:
>
>"\[ [^\]]*]" which means looking for an open bracket followed by zero
> to any number of chars which are not a close bracket, and last a close
> bracket.
> BTW, no need to escape the last closing bracket; the regex engine is smart
> enough.
>
>
> PCRE library accepts the 2 forms.
>
> HTH,
>
> Thierry
>  ​
>

-- 

Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-19 Thread Thierry Douez via use-livecode
>
>
>> put "1 [A] 2 [B] 3." into tText
>> put  removeBrackets( tText)
>>
>
> I see that the middle section is omitted with my regex, so I forgot to
> make it non-greedy. But I've forgotten how to do that, something about a
> question mark, I think?


​Sorry about the delay, we had a thunderstorm which broke all Internet
network
in our area since last Friday.

You can do this in 2 ways:

- make your .* non greedy by adding a '?' suffix

- or modify your regex this way:

   "\[ [^\]]*]" which means looking for an open bracket followed by zero to
any number of chars which are not a close bracket, and last a close bracket.
BTW, no need to escape the last closing bracket; the regex engine is smart
enough.


PCRE library accepts the 2 forms.

HTH,

Thierry
​
-- 

Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-12 Thread J. Landman Gay via use-livecode

On 5/12/17 3:37 PM, Thierry Douez via use-livecode wrote:

This should be a one-line command!
I've typed this post with the new Opera browser
???


Another try with 2 lines:

put "1 [A] 2 [B] 3." into tText
put  removeBrackets( tText)

​Better?


Yes. It's odd that a browser would reformat it that way.

I see that the middle section is omitted with my regex, so I forgot to 
make it non-greedy. But I've forgotten how to do that, something about a 
question mark, I think?


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-12 Thread Thierry Douez via use-livecode
>
>
>>
>>
>>> function removeBrackets pString
>>>   return replacetext(pString,"\[.*\]",empty)
>>> end removeBrackets
>>>
>> ​​
>>
>> What would be the result of next  line:?
>>
>> *put* removeBrackets
>> ​( ​
>> "1 [A] 2 [B] 3."
>> ​)
>>
>
> An error. I did warn about my limited regex skills. :)

So what should it be?
>
> Also, that's a non-standard format for a function.

I've never seen it written that way before.


​

This should be a one-line command!
I've typed this post with the new Opera browser
???


Another try with 2 lines:

put "1 [A] 2 [B] 3." into tText
put  removeBrackets( tText)

​Better?

Thierry​



Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-12 Thread J. Landman Gay via use-livecode

On 5/12/17 2:08 AM, Thierry Douez via use-livecode wrote:

​Hi,





function removeBrackets pString
  return replacetext(pString,"\[.*\]",empty)
end removeBrackets



​​

What would be the result of next  line:?

*put* removeBrackets
​( ​
"1 [A] 2 [B] 3."
​)


An error. I did warn about my limited regex skills. :) So what should it be?

Also, that's a non-standard format for a function. I've never seen it 
written that way before.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-12 Thread Thierry Douez via use-livecode
​Hi,



>
> function removeBrackets pString
>   return replacetext(pString,"\[.*\]",empty)
> end removeBrackets
>
>
​​

What would be the result of next  line:?

*put* removeBrackets
​( ​
"1 [A] 2 [B] 3."
​)


Kind regards,

Thierry
​

Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-10 Thread Nicolas Cueto via use-livecode
> Totally OT, but is this Dante, in Spanish??

Yes, and yes. From the verse translation of Ángel Crespo.

--
Nicolas Cueto

On 10 May 2017 at 19:57, Graham Samuel via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Totally OT, but is this Dante, in Spanish??
>
> Just askin’. I am not good with languages, as you can probably tell.
>
> Graham
>
> > On 10 May 2017, at 06:33, J. Landman Gay via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > On 5/9/17 11:16 PM, J. Landman Gay via use-livecode wrote:
> >> On 5/9/17 10:41 PM, Nicolas Cueto via use-livecode wrote:
> >>> Given this snippet...
> >>>
> >>> ---
> >>> CANTO XXXIV
> >>> CÍRCULO IX: TRAIDORES.
> >>> «Vexilla regis prodeunt[307] del Abismo
> >>> hacia nosotros[308], mas delante mira
> >>> 3—dijo el maestro— y los verás tú mismo.»
> >>> ---
> >>>
> >>> ... how do I use LC to remove the square-brackets and any string within
> >>> them, so that the snippet becomes...
> >>>
> >>> ---
> >>> CANTO XXXIV
> >>> CÍRCULO IX: TRAIDORES.
> >>> «Vexilla regis prodeunt del Abismo
> >>> hacia nosotros, mas delante mira
> >>> 3—dijo el maestro— y los verás tú mismo.»
> >>> ---
> >>
> >> This is about the only thing I know how to do with regext. :)
> >>
> >> on fix
> >>  put fld 1 into tText
> >>  put "\[.*\]" into tRegEx
> >>  put replacetext(tText,tRegEx,empty) into fld 2
> >> end fix
> >>
> >
> > You'd probably want it to be a function though:
> >
> > function removeBrackets pString
> >  return replacetext(pString,"\[.*\]",empty)
> > end removeBrackets
> >
> > --
> > Jacqueline Landman Gay | jac...@hyperactivesw.com
> > HyperActive Software   | http://www.hyperactivesw.com
> >
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-10 Thread Graham Samuel via use-livecode
Totally OT, but is this Dante, in Spanish??

Just askin’. I am not good with languages, as you can probably tell.

Graham

> On 10 May 2017, at 06:33, J. Landman Gay via use-livecode 
>  wrote:
> 
> On 5/9/17 11:16 PM, J. Landman Gay via use-livecode wrote:
>> On 5/9/17 10:41 PM, Nicolas Cueto via use-livecode wrote:
>>> Given this snippet...
>>> 
>>> ---
>>> CANTO XXXIV
>>> CÍRCULO IX: TRAIDORES.
>>> «Vexilla regis prodeunt[307] del Abismo
>>> hacia nosotros[308], mas delante mira
>>> 3—dijo el maestro— y los verás tú mismo.»
>>> ---
>>> 
>>> ... how do I use LC to remove the square-brackets and any string within
>>> them, so that the snippet becomes...
>>> 
>>> ---
>>> CANTO XXXIV
>>> CÍRCULO IX: TRAIDORES.
>>> «Vexilla regis prodeunt del Abismo
>>> hacia nosotros, mas delante mira
>>> 3—dijo el maestro— y los verás tú mismo.»
>>> ---
>> 
>> This is about the only thing I know how to do with regext. :)
>> 
>> on fix
>>  put fld 1 into tText
>>  put "\[.*\]" into tRegEx
>>  put replacetext(tText,tRegEx,empty) into fld 2
>> end fix
>> 
> 
> You'd probably want it to be a function though:
> 
> function removeBrackets pString
>  return replacetext(pString,"\[.*\]",empty)
> end removeBrackets
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-09 Thread J. Landman Gay via use-livecode

On 5/9/17 11:16 PM, J. Landman Gay via use-livecode wrote:

On 5/9/17 10:41 PM, Nicolas Cueto via use-livecode wrote:

Given this snippet...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt[307] del Abismo
hacia nosotros[308], mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---

... how do I use LC to remove the square-brackets and any string within
them, so that the snippet becomes...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt del Abismo
hacia nosotros, mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---


This is about the only thing I know how to do with regext. :)

on fix
  put fld 1 into tText
  put "\[.*\]" into tRegEx
  put replacetext(tText,tRegEx,empty) into fld 2
end fix



You'd probably want it to be a function though:

function removeBrackets pString
  return replacetext(pString,"\[.*\]",empty)
end removeBrackets

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-09 Thread Nicolas Cueto via use-livecode
​Thank you everyone. Went with ​Jacqueline's, cause fastest.

--
N. Cueto
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-09 Thread J. Landman Gay via use-livecode

On 5/9/17 10:41 PM, Nicolas Cueto via use-livecode wrote:

Given this snippet...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt[307] del Abismo
hacia nosotros[308], mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---

... how do I use LC to remove the square-brackets and any string within
them, so that the snippet becomes...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt del Abismo
hacia nosotros, mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---


This is about the only thing I know how to do with regext. :)

on fix
  put fld 1 into tText
  put "\[.*\]" into tRegEx
  put replacetext(tText,tRegEx,empty) into fld 2
end fix

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-09 Thread Phil Davis via use-livecode

There is probably an easier way, but this works:

   on mouseUp
put "]" & field 1 into tText
set the lineDelimiter to "["
set the itemDelimiter to "]"
repeat for each line tLine in tText
put item 2 to -1 of tLine after tNewText
end repeat
put tNewText into field 2
   end mouseUp

HTH -
Phil Davis


On 5/9/17 8:41 PM, Nicolas Cueto via use-livecode wrote:

Given this snippet...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt[307] del Abismo
hacia nosotros[308], mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---

... how do I use LC to remove the square-brackets and any string within
them, so that the snippet becomes...

---
CANTO XXXIV
CÍRCULO IX: TRAIDORES.
«Vexilla regis prodeunt del Abismo
hacia nosotros, mas delante mira
3—dijo el maestro— y los verás tú mismo.»
---

Muchas gracias.

--
Nicolás Cueto
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


--
Phil Davis

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: filter? replace? wildcard? reg exp? help please!

2017-05-09 Thread Peter Bogdanoff via use-livecode
Try—
put your text into tText, then

repeat forever
if offset("[",tText) is not empty then
delete char (offset("[",tText)) to (offset("]",tText)) of tText
else
exit repeat
end repeat



On May 9, 2017, at 8:54 PM, Peter Bogdanoff via use-livecode 
 wrote:

> use offset.
> 
> Peter
> 
> 
> On May 9, 2017, at 8:41 PM, Nicolas Cueto via use-livecode 
>  wrote:
> 
>> Given this snippet...
>> 
>> ---
>> CANTO XXXIV
>> CÍRCULO IX: TRAIDORES.
>> «Vexilla regis prodeunt[307] del Abismo
>> hacia nosotros[308], mas delante mira
>> 3—dijo el maestro— y los verás tú mismo.»
>> ---
>> 
>> ... how do I use LC to remove the square-brackets and any string within
>> them, so that the snippet becomes...
>> 
>> ---
>> CANTO XXXIV
>> CÍRCULO IX: TRAIDORES.
>> «Vexilla regis prodeunt del Abismo
>> hacia nosotros, mas delante mira
>> 3—dijo el maestro— y los verás tú mismo.»
>> ---
>> 
>> Muchas gracias.
>> 
>> --
>> Nicolás Cueto
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter? replace? wildcard? reg exp? help please!

2017-05-09 Thread Peter Bogdanoff via use-livecode
use offset.

Peter


On May 9, 2017, at 8:41 PM, Nicolas Cueto via use-livecode 
 wrote:

> Given this snippet...
> 
> ---
> CANTO XXXIV
> CÍRCULO IX: TRAIDORES.
> «Vexilla regis prodeunt[307] del Abismo
> hacia nosotros[308], mas delante mira
> 3—dijo el maestro— y los verás tú mismo.»
> ---
> 
> ... how do I use LC to remove the square-brackets and any string within
> them, so that the snippet becomes...
> 
> ---
> CANTO XXXIV
> CÍRCULO IX: TRAIDORES.
> «Vexilla regis prodeunt del Abismo
> hacia nosotros, mas delante mira
> 3—dijo el maestro— y los verás tú mismo.»
> ---
> 
> Muchas gracias.
> 
> --
> Nicolás Cueto
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter lines of a variable that start with...

2014-05-03 Thread Keith Clarke
…of course, it would have helped if I’d added the “*” wild card to the end of 
the filter - doh! :-)

 filter tSearchResultsHTML withli*

Best,
Keith..

On 3 May 2014, at 15:14, Keith Clarke keith.cla...@clarkeandclarke.co.uk 
wrote:

 Hi folks,
 I’m working on a little utility to analyse Google search results and I’m 
 trying to isolate just the results list (which sit in an unordered list) form 
 the rest of the HTML page source noise.
 
 I wanted to filter lines with the first 3 chars are “li” but I’m struggling 
 to get the basic 'filter lines with” function to behave. The first line of 
 this script seems to be successfully inserting returns before the opening 
 li…  tags. I’ve checked this by putting the result in the message box and 
 also copying  pasting the resulting content into a text editor. However, the 
 second line - which is meant to remove any lines that don’t contain the 
 opening li… tag - is currently behaving as if the line breaks haven’t been 
 inserted.
 
 Currently the effect of the second line is that the output 
 ‘SearchResultsList' field shows:
 Nothing when the filter is in its ‘with’ form - as shown
 All lines in the source when in its ‘without’ form
 
replace li with (return  li) in tSearchResultsHTML
filter lines of tSearchResultsHTML with li
put tSearchResultsHTML into field SearchResultsList” 
 
 I’ve tried setting the rowDelimiter to return with no effect. Any clues on 
 where this logic is broken?
 Best,
 Keith..

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter appears to work differently when single stepping

2013-09-12 Thread Klaus major-k
Hi Richard,

Am 12.09.2013 um 18:26 schrieb Dr. Hawkins doch...@gmail.com:

 I have a global dhUpCds for a list of long names of cards that get
 updated.  When a card closes, I want them removed
 
 I made a handler
 
on dhRmUpCd oldCd
  global dhUpCds
 
   ## Try with parens:
   filter dhUpCds without (*  oldCd)
end dhRmUpCd

 This is designed to accept either a card name or stack name.
 
 I'm finding that it always works as expected when single stepping in
 the IDE, but that the filtering does not work all of the time when
 running.  Even single stepping to that point and hitting the blue run
 button seems to leave the command unprocessed.
 
 -- 
 Dr. Richard E. Hawkins, Esq.
 (702) 508-8462

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter appears to work differently when single stepping

2013-09-12 Thread Dr. Hawkins
On Thu, Sep 12, 2013 at 9:32 AM, Klaus major-k kl...@major-k.de wrote:

## Try with parens:
filter dhUpCds without (*  oldCd)

Thanks.  THis may have done it.

It also seems that the watch window for my variable does not get
updated after the last iteration until I click on another window--even
though it has focus neither before or after . . .

grr.




-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter with a tab character

2013-02-04 Thread Klaus on-rev
Hi Hugh,

Am 04.02.2013 um 18:04 schrieb FlexibleLearning.com 
ad...@flexiblelearning.com:

 I have tab-delimited list and am trying to filter lines.
 
 
 Q1. How do we include a TAB character in the expression? Using filter with
 *\tsomeText fails.

use the contant TAB:
...
filter tList with (*  TAB  whatever)
...

 Q2. How do we specify a maximum numeric value? Using filter with *[18]
 fails.

Sorry, no idea. 
Maybe with some RegeEx?

 Have tried reading up on Bourne Shell but am totally confused!
 
 Thanks.
 
 Hugh Senior
 FLCo

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major.on-rev.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter with a tab character

2013-02-04 Thread Richard Gaskin

Klaus wrote:

Am 04.02.2013 um 18:04 schrieb FlexibleLearning.com:


I have tab-delimited list and am trying to filter lines.

Q1. How do we include a TAB character in the expression? Using filter with
*\tsomeText fails.


use the contant TAB:
...
filter tList with (*  TAB  whatever)



While the filter command is seductively simple to use, if your rows have 
many columns and you're filtering on one several columns in, you may 
find repeat for each will be more efficient:


http://article.gmane.org/gmane.comp.ide.revolution.user/72192/match=filter+tab+gaskin


--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 Follow me on Twitter:  http://twitter.com/FourthWorldSys

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter with a tab character

2013-02-04 Thread Mike Bonner
I think you could also use \t to signify a tab char.

As for the matching a range of numbers you'd probably be better served to
have lc handle whatever is leftover. However, barring that, you might look
at this page: http://www.regular-expressions.info/numericranges.html for an
explanation of how to get it done.


On Mon, Feb 4, 2013 at 10:09 AM, Klaus on-rev kl...@major.on-rev.comwrote:

 Hi Hugh,

 Am 04.02.2013 um 18:04 schrieb FlexibleLearning.com
 ad...@flexiblelearning.com:

  I have tab-delimited list and am trying to filter lines.
 
 
  Q1. How do we include a TAB character in the expression? Using filter
 with
  *\tsomeText fails.

 use the contant TAB:
 ...
 filter tList with (*  TAB  whatever)
 ...

  Q2. How do we specify a maximum numeric value? Using filter with *[18]
  fails.

 Sorry, no idea.
 Maybe with some RegeEx?

  Have tried reading up on Bourne Shell but am totally confused!
 
  Thanks.
 
  Hugh Senior
  FLCo

 Best

 Klaus

 --
 Klaus Major
 http://www.major-k.de
 kl...@major.on-rev.com


 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter with a tab character

2013-02-04 Thread Paul Hibbert
filter searches for a pattern, not a value, so this can work to filter anything 
'less than 18', but would work to filter results with the chars , 1 or 8.

Paul

On 2013-02-04, at 9:04 AM, FlexibleLearning.com wrote:

 Q2. How do we specify a maximum numeric value? Using filter with *[18]
 fails.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter with a tab character

2013-02-04 Thread Paul Hibbert
Sorry, that should have read can't work not can work.

On 2013-02-04, at 9:48 AM, Paul Hibbert wrote:

 filter searches for a pattern, not a value, so this can work to filter 
 anything 'less than 18', but would work to filter results with the chars , 
 1 or 8.
 
 Paul
 
 On 2013-02-04, at 9:04 AM, FlexibleLearning.com wrote:
 
 Q2. How do we specify a maximum numeric value? Using filter with *[18]
 fails.
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter with a tab character

2013-02-04 Thread Thierry Douez
2013/2/4 FlexibleLearning.com ad...@flexiblelearning.com

 I have tab-delimited list and am trying to filter lines.

 Q1. How do we include a TAB character in the expression? Using filter with
 *\tsomeText fails.


see \s below



 Q2. How do we specify a maximum numeric value? Using filter with *[18]
 fails.



on mouseUp
   local tmp
   put fld 1 into tList
   -- \s match space and tab
   -- get \s[0-9]\s -- any 0 to 9 single number
   -- get \s[1-4][0-9]\s -- accept  10 to 49
   -- get \s[1-4]\d\s -- accept  10 to 49
   -- get \s[1-4]?\d\s -- accept  0 to 49
   get \s[1-4]?(\d){1,3}\s -- accept  0 to 4999
   repeat for each line L in tList
  if matchText( L, IT ) then put L cr after tmp
   end repeat
   put tmp
end mouseUp

Forget about filter; it doesn't play with regex, just sort of...

my fld test contains:

hjkdf sdfsdflkj 987dsf sdf sdf
fgffg gf gf4998 fd ddf ddfd
fgffg gf gf5000 fd ddf ddfd
ere e re 1234567890e
gfgjfkgf dfglwer 0 fdfsla sdfsdf
gfgjfkgf dfglwer 42fdfsla sdfsdf
try tytry retert  41dfsdffdsd
sdflk; asdf 33dfdfdfsa dsfsdff
kjklj jlkjlk 7ljlkj lkjkjlkj jljljkl


And it's fast.

HTH,

Thierry
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter with a tab character

2013-02-04 Thread Thierry Douez
Forgot one  which maybe you need:

   get \s([1-3]?\d|[4][0-2])\s -- accept 0 to 42

Regards,

Thierry


2013/2/4 Thierry Douez th.do...@gmail.com


 2013/2/4 FlexibleLearning.com ad...@flexiblelearning.com

 I have tab-delimited list and am trying to filter lines.

 Q1. How do we include a TAB character in the expression? Using filter with
 *\tsomeText fails.


 see \s below



 Q2. How do we specify a maximum numeric value? Using filter with *[18]
 fails.



 on mouseUp
local tmp
put fld 1 into tList
-- \s match space and tab
-- get \s[0-9]\s -- any 0 to 9 single number
-- get \s[1-4][0-9]\s -- accept  10 to 49
-- get \s[1-4]\d\s -- accept  10 to 49
-- get \s[1-4]?\d\s -- accept  0 to 49
get \s[1-4]?(\d){1,3}\s -- accept  0 to 4999
repeat for each line L in tList
   if matchText( L, IT ) then put L cr after tmp
end repeat
put tmp
 end mouseUp

 Forget about filter; it doesn't play with regex, just sort of...

 my fld test contains:

 hjkdf sdfsdflkj 987dsf sdf sdf
 fgffg gf gf4998 fd ddf ddfd
 fgffg gf gf5000 fd ddf ddfd
 ere e re 1234567890e
 gfgjfkgf dfglwer 0 fdfsla sdfsdf
 gfgjfkgf dfglwer 42fdfsla sdfsdf
 try tytry retert  41dfsdffdsd
 sdflk; asdf 33dfdfdfsa dsfsdff
 kjklj jlkjlk 7ljlkj lkjkjlkj jljljkl


 And it's fast.

 HTH,

 Thierry


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: filter with a tab character

2013-02-04 Thread FlexibleLearning.com
Thanks for the insights. Much appreciated.

The list to filter is not enormous, but the 'for each' option would also
handle any numeric evaluations, so both solutions will be valuable.

Hugh Senior
FLCo



Klaus wrote:
 Am 04.02.2013 um 18:04 schrieb FlexibleLearning.com:

 I have tab-delimited list and am trying to filter lines.

 Q1. How do we include a TAB character in the expression? Using filter
with
 *\tsomeText fails.

 use the contant TAB:
 ...
 filter tList with (*  TAB  whatever)

Richard wrote:
While the filter command is seductively simple to use, if your rows have
many columns and you're filtering on one several columns in, you may
find repeat for each will be more efficient:

http://article.gmane.org/gmane.comp.ide.revolution.user/72192/match=filter
+tab+gaskin


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter and the Question Mark (escaping ? in regex)

2013-01-24 Thread Thierry Douez
Hi Bob,

You are wrong and right :)

Right because that's how regex works in most  environment.

Wrong because regex inside Livecode behave sometimes in strange ways...

Anyway, be happy.

Thierry


2013/1/23 Robert Sneidar slylab...@me.com

 I mean Thierry

  I just checked this, and Malte is correct. I see now why the second
 example would only select lines ending in ?. I should probably remove
 expert in regex from my resume? ;-)
 
  Bob
 
 
  On Jan 23, 2013, at 3:30 AM, Thierry Douez wrote:
 
  Hi Malte,
 
  for any position of ? in a line:  filter tText with *[?]*
 
  for the last char of a line:  filter tText with *[?]
 
  Regards,
  Thierry

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter and the Question Mark (escaping ? in regex)

2013-01-23 Thread Mark Schonewille

Malte,

Try this:

   filter tText with *[?]*

Kind regards,

Mark



On 1/23/2013 11:49 AM, Malte Brill wrote:

Hi,

I got a var tText that contains:

asdf
jkl?
bcdk

I want to do something like this

filter tText with *\?*

which should leave me with only jkl?. This does not appear to work. Any 
pointers on how to correctly escape the question mark greatly appreciated.

Cheers,

Malte


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter and the Question Mark (escaping ? in regex)

2013-01-23 Thread Thierry Douez
Hi Malte,

for any position of ? in a line:  filter tText with *[?]*

for the last char of a line:  filter tText with *[?]

Regards,

Thierry


2013/1/23 Malte Brill revolut...@derbrill.de

 Hi,

 I got a var tText that contains:

 asdf
 jkl?
 bcdk

 I want to do something like this

 filter tText with *\?*

 which should leave me with only jkl?.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter and the Question Mark (escaping ? in regex)

2013-01-23 Thread Robert Sneidar
It's my understanding that * means 0 to any number of characters, in which case 
these are both the same thing. I might be wrong though. Might explain why some 
of my filtering is not working as expected. :-)

Bob


On Jan 23, 2013, at 3:30 AM, Thierry Douez wrote:

 Hi Malte,
 
 for any position of ? in a line:  filter tText with *[?]*
 
 for the last char of a line:  filter tText with *[?]
 
 Regards,
 
 Thierry
 
 
 2013/1/23 Malte Brill revolut...@derbrill.de
 
 Hi,
 
 I got a var tText that contains:
 
 asdf
 jkl?
 bcdk
 
 I want to do something like this
 
 filter tText with *\?*
 
 which should leave me with only jkl?.
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter and the Question Mark (escaping ? in regex)

2013-01-23 Thread Robert Sneidar
I just checked this, and Malte is correct. I see now why the second example 
would only select lines ending in ?. I should probably remove expert in regex 
from my resume? ;-)

Bob


On Jan 23, 2013, at 3:30 AM, Thierry Douez wrote:

 Hi Malte,
 
 for any position of ? in a line:  filter tText with *[?]*
 
 for the last char of a line:  filter tText with *[?]
 
 Regards,
 
 Thierry
 
 
 2013/1/23 Malte Brill revolut...@derbrill.de
 
 Hi,
 
 I got a var tText that contains:
 
 asdf
 jkl?
 bcdk
 
 I want to do something like this
 
 filter tText with *\?*
 
 which should leave me with only jkl?.
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter and the Question Mark (escaping ? in regex)

2013-01-23 Thread Robert Sneidar
I mean Thierry

 I just checked this, and Malte is correct. I see now why the second example 
 would only select lines ending in ?. I should probably remove expert in 
 regex from my resume? ;-)
 
 Bob
 
 
 On Jan 23, 2013, at 3:30 AM, Thierry Douez wrote:
 
 Hi Malte,
 
 for any position of ? in a line:  filter tText with *[?]*
 
 for the last char of a line:  filter tText with *[?]
 
 Regards,
 
 Thierry
 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter probelm

2012-03-14 Thread Pete
Duh!! Thank you Terry.
Pete

On Tue, Mar 13, 2012 at 9:35 PM, Terry Judd terry.j...@unimelb.edu.auwrote:


 On 14/03/2012, at 02:52 PM, Pete wrote:

 Unless I'm doing something wrong, filter tvar without tab doesn't work,
 that is the lines with a tab remain in tvar after the filter command.

 Suer would be nice to have that work when dynamically building the contents
 of a popup menu with indented lines in it...

 That would only work if the lines you wanted to filter out only contained
 a tab character. If they contain other stuff then you need one of the
 following...

 filter tvar without (*tab*) -- if the tab can be anywhere in the line
 filter tvar without (tab*) -- if the tab is at the start of the line, or
 filter tvar without (*tab) -- if the tab is at the end of the line

 Terry...

 --
 Pete
 Molly's Revenge http://www.mollysrevenge.com
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.commailto:use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


 Dr Terry Judd
 Senior Lecturer in Medical Education
 Medical Eduction Unit
 Faculty of Medicine, Dentistry  Health Sciences
 The University of Melbourne



 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




-- 
Pete
Molly's Revenge http://www.mollysrevenge.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Filter probelm

2012-03-13 Thread Terry Judd

On 14/03/2012, at 02:52 PM, Pete wrote:

Unless I'm doing something wrong, filter tvar without tab doesn't work,
that is the lines with a tab remain in tvar after the filter command.

Suer would be nice to have that work when dynamically building the contents
of a popup menu with indented lines in it...

That would only work if the lines you wanted to filter out only contained a tab 
character. If they contain other stuff then you need one of the following...

filter tvar without (*tab*) -- if the tab can be anywhere in the line
filter tvar without (tab*) -- if the tab is at the start of the line, or
filter tvar without (*tab) -- if the tab is at the end of the line

Terry...

--
Pete
Molly's Revenge http://www.mollysrevenge.com
___
use-livecode mailing list
use-livecode@lists.runrev.commailto:use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Dr Terry Judd
Senior Lecturer in Medical Education
Medical Eduction Unit
Faculty of Medicine, Dentistry  Health Sciences
The University of Melbourne



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


  1   2   >