Regular Expression Question

Gordon Tillman got at mindspring.com
Tue Jul 10 10:12:19 CDT 2007


Len try this in the message box:

put "approved_by_code" into tFind
get matchText(tFind, "^(.*?)[^_]*$", p1)
put len(p1)

that outputs 12.  And with a string that contains no "_" it outputs 0

--gordy

On Jul 10, 2007, at 09:55, Len Morgan wrote:

> I need to find the last matching character offset of a string  
> withing another string.  The offset function only gives me the  
> first one.  Is there a function I'm missing (like "offset from end  
> of string") or a one or two liner I can use?
>
> Example:
>
> approved_by_code - I'm looking for the offset to the second "_"  
> character so the result should be 12 in this example.  It is also  
> possible that there will only be one "_" character in which case,  
> that is the offset I want.
>
> Thanks in advance!
>
> Len Morgan
> _______________________________________________
> 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