[Xml-compile] Re: Xml-compile Digest, Vol 25, Issue 9

Titi Ala'ilima titi at leadkarma.com
Sun Apr 25 12:42:57 GMT 2010


On Apr 25, 2010, at 8:00 AM, xml-compile-request at lists.scsys.co.uk  
wrote:

> I have no idea (yet) why this string does not match
>
>   'PT5M' =~ m/^\-?P(?:\d+Y)?(?:\d+M)?(?:\d+D)?
>      (?:T(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d+)?)S)?$/x
>
> anyone?

The parens are messed up at the end, so an S would be required at the  
end of any time phrases. This is probably what you want:

> m/^\-?P(?:\d+Y)?(?:\d+M)?(?:\d+D)?
>      (?:T(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d+)?S)?)?$/x

Titi



More information about the Xml-compile mailing list