matchText question

Michael Doub mikedoub at gmail.com
Wed Feb 25 19:23:04 EST 2015


if any one is interested.   I did this hoping that it would speed up my 
parsing.  As it turns out my original version was faster.   The original 
had 8 separate matchTexts with straight forward expresions, where the 
last version had 2 matchtexts with expressions lots of alternatives.

Original:  1620 millisec
Latest: 1641 millisec

For the curious: 
https://www.dropbox.com/s/20j4iy4oomrr12c/Parser.livecode?dl=0

Thanks again for everyone's help.

-= Mike



On 2/25/15 6:52 PM, Mike Bonner wrote:
>            "^\s*(/\*).*" \ works, if you're trying to match opening /*
> comments.
> If you're trying to match lines that start with * thats a different story.
> \* matches asterisk.  /\* matches /*
> If you want to grab the whole comment line move the .* inside the parens.
> Not sure what the "include" line you're trying to match should look like
> either, something funky up there, but without seeing what you need to
> match, its hard to figure out.
>
> On Wed, Feb 25, 2015 at 4:31 PM, Mike Bonner <bonnmike at gmail.com> wrote:
>
>> Hey, correct me if i'm wrong, but \w+ is a geedy word grab right?  Which
>> should grab to the end if the line.. Seems like the .*+ wouldn't even be
>> necessary... Yep, just checked. Its not. The only part I can't get to work
>> is the last line for /*.  Not sure what it is i'm not seeing.
>>
>> On Wed, Feb 25, 2015 at 3:53 PM, Mike Bonner <bonnmike at gmail.com> wrote:
>>
>>> Yes, it was to me too. Though, I did end up breaking it down into singles
>>> and they all behaved the same, which made it easier to take a WAG.  Less
>>> wild than it would have otherwise been. Find the thing that's the same for
>>> each part, and decide if its broke.
>>>
>>> On Wed, Feb 25, 2015 at 2:50 PM, stephen barncard <
>>> stephenREVOLUTION2 at barncard.com> wrote:
>>>
>>>> On Wed, Feb 25, 2015 at 12:29 PM, Mike Bonner <bonnmike at gmail.com>
>>>> wrote:
>>>>
>>>>> Try this instead..
>>>>>      put "(?i)^\s*(\-\-\s+begin)\s+(\w+).*+|" & \
>>>>>           "^\s*(on)\s+(\w+).*+|" & \
>>>>>           "^\s*(function)\s+(\w+).*+|" & \
>>>>>           "^\s*(command)\s+(\w+).*+|" & \
>>>>>           "^\s*(private\s+function)\s+(\w+).*+|" & \
>>>>>           "^\s*(private\s+command)\s+(\w+).*+|" & \
>>>>>           "^\s*(\/\*\s+include).*+|" &  \
>>>>>            "^\s*(\*\/).*+" \
>>>>>           into expr
>>>>>
>>>> breaking down and displaying complex REGEX this way is very helpful.
>>>>
>>>> *--*
>>>> *Stephen Barncard - San Francisco Ca. USA - Deeds Not Words*
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> use-livecode at 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 at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>





More information about the use-livecode mailing list