Regular Expression question

Devin Asay devin_asay at byu.edu
Thu Aug 10 13:47:33 EDT 2006


On Aug 10, 2006, at 10:56 AM, Robert Sneidar wrote:

> Well that brings up an interesting point. When I refer to a chunk  
> "line x" in my example, Revolution does not include the paragraph  
> delimiter, but in Devin's it does. How odd then that the  
> interpretation of what is meant by "line" is modified by how you  
> compare it with something else. Far be it from me to criticize  
> <tongue firmly implanted in cheek> but shouldn't "line x" mean  
> exactly the same thing no matter where or how you use it? Ambiguity  
> in interpretation is programmer's purgatory. (Hey! A new Sly  
> Saying!) Good catch though.

Add this to the bizarre list. It might be worth a trip to bugzilla if  
you have a recipe for them.

Devin

>
> On Aug 9, 2006, at 8:07 PM, use-revolution-request at lists.runrev.com  
> wrote:
>
>> Having been caught by things like this before, I would suggest a
>> small modification to Bob's script:
>>
>> On Aug 9, 2006, at 12:21 PM, Robert Sneidar wrote:
>>
>>>
>>> put <yourdatahere> into moldlist
>>> put "" into mnewlist
>>>
>>> repeat for each line theLine of moldlist
>>> if line theLine is among the lines of mnewlist then
>> 		    ^^^^^^^^^^^^^^^^^^^
>>>   next repeat
>>> else
>>>   put line theLine of moldlist & return after mnewlist
>>> end repeat
>>
>> This will work if the numbers in your list go to > 9 and they are not
>> in numeric order. For instance,
>>
>> 10
>> 10
>> 10
>> 2
>> 2
>> 1
>> 1
>> 1
>>
>> If you just check "is in" the script will skip '1', since 1 is in 10.
>> The 'among the lines of' forces the comparison to only consider whole
>> line matches.

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University




More information about the use-livecode mailing list