livecheck.regex

Ryan Schmidt ryandesign at macports.org
Fri Jun 26 23:44:56 PDT 2009


On Jun 20, 2009, at 12:51, James Kyle wrote:

> It looks like the livecheck.regex rules are not the same as the tcl  
> regex rules.

They should be the same, remembering to take into account the extra  
level of escaping you need if you use double-quote characters instead  
of curly braces.

> I could be sorely mistaken since I have very limited exposure to tcl.
>
> However, this is what I'm seeing:
>
> in the tclsh, the following pattern matches correctly:
>
> % set text "newmat10.tar.gz or newmat10.zip - newmat10D source files"
> newmat10.tar.gz or newmat10.zip - newmat10D source files
> % set worldlist [regexp -inline -all -- {newmat(10)\.tar\.gz or  
> newmat10\.zip - newmat10D source files} $text]
> {newmat10.tar.gz or newmat10.zip - newmat10D source files} 10
> % exit
>
>
> The $text is a cut and paste from the site I'm trying to match.
>
> The same pattern fails when using livecheck.regex
>
>> livecheck.regex    {newmat(10)\.tar\.gz or newmat10\.zip -  
>> newmat10D source files}
>
>> port livecheck newmat => Error: cannot check if newmat was updated  
>> (regex didn't match)
>
>
> Ignoring for the moment that that the regex is far too specific,  
> what are the differences between tcl regex and livecheck.regex that  
> cause one to match and the other to fail?
>
> For context, I ran into this when trying to do a lookahead match  
> that excluded strings with the word "beta" in them. . . something  
> like this:
>
> {newmat([0-9.]+).tar.gz.*(?!.*beta)}

I don't know if the "(?...)" syntax works in Tcl.



More information about the macports-dev mailing list