Matchtext

Dar Scott dsc at swcp.com
Thu Jul 31 11:46:01 EDT 2003


On Thursday, July 31, 2003, at 07:18 AM, Yves COPPE wrote:

>     if  
> matchtext(theLine,"(0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[0-2])/([0-9][0- 
> 9])",theDay,TheMonth,TheYear) is true then

Try this:
"([ 0][1-9]|[12][0-9]|3[01])/(0[1-9]|1[0-2])/([0-9][0-9])"

This will include the space in theDay and there must be space or zero.   
This can be enhanced to exclude the space and to allow other situations  
such as the string starting with a one digit day.

This assumes a two digit year, as the original, so it is picking up  
only the 20 of 2003.  It can be enhanced to work with 4 digit and even  
to skip over a "20" if needed.

This can also be enhanced to handle a single digit month, also.

Dar Scott


************************************************************************ 
****
   Dar Scott Consulting    http://www.swcp.com/dsc/    Programming  
Services
************************************************************************ 
****




More information about the use-livecode mailing list