filter list for range of numbers

Jim Ault JimAultWins at yahoo.com
Sun Feb 26 22:08:42 EST 2006


On 2/26/06 1:59 PM, "dreamscapesoftware.com - List"
<list at dreamscapesoftware.com> wrote:
>I'm trying to utilize the
> "filter container with regex" command as opposed to looping through a list as
> much as possible.  Reason:  it's faster.
<full version below>

First understand that RegEx is pretty much just string searching/pattern
searching, and if there are a lot of "matches" it goes pretty slow.

Second, try to define the true scope of the problem by considering how many
lines of data would be scanned at one time, does the user have to wait while
this is accomplished, are there smarter ways of using 'replace' 'filter'
etc.

Questions:
1-- How many number are you processing (10, 10K, 100K)?
2-- Are the "+" and "-" signs present as you indicate?
3-- Would sort ascending, scan, then sort descending, scan >> find the key
lines to then 'get line topp to bott of numberList
4-- Is math necessary, or could the simple string be analyzed to do a coarse
cut, then use a repeat to refine the smaller list a both ends?

5--  What does "-067.145780" stand for, since this would indeed be a string
and not a real number with the leading 0.

My first glance would try to sort, snip, sort, snip, refine with
[math/filter/regex/replace].


Jim Ault
Las Vegas

On 2/26/06 1:59 PM, "dreamscapesoftware.com - List"
<list at dreamscapesoftware.com> wrote:

> Hello List,
> 
> It's been a while since I've posted here, but I've got a question about
> something that's been bugging me for a long time.  I'm trying to utilize the
> "filter container with regex" command as opposed to looping through a list as
> much as possible.  Reason:  it's faster.  The only problem is that I can't
> seem to make a Regex that will handle the following...
> 
> if (aNumber > lowNumber) and (aNumber < highNumber) then -- Don't remove it
> from the list
> 
> Anyone know how I can achieve this with Regex?  The numbers are like this...
> 
> +40.922362
> +18.393103
> -067.145780
> -072.637078
> 
> 
> -- Derek Bump
> -- Dreamscape Software
> 
> 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list