Re: [34499] trunk/dports/devel/bzr/Portfile
On Feb 26, 2008, at 21:24, ram@macports.org wrote:
+livecheck.check regex +livecheck.url ${homepage} +livecheck.regex "Bazaar (\[0-9\]+\.\[0-9\]+) was released"
Note that "\." in a tcl string expressed in double quotes is translated by tcl to "." so if you really want the regex engine to see "\." you need to either write "\\." inside the double-quoted string, or use curly brackets as your regex string encloser and then don't use backslashes in front of special tcl characters. Either
livecheck.regex "Bazaar (\[0-9\]+\\.\[0-9\]+) was released"
or
livecheck.regex {Bazaar ([0-9]+\.[0-9]+) was released}
would be correct.
On Thu, Feb 28, 2008 at 1:31 AM, Ryan Schmidt <ryandesign@macports.org> wrote:
On Feb 26, 2008, at 21:24, ram@macports.org wrote:
+livecheck.check regex +livecheck.url ${homepage} +livecheck.regex "Bazaar (\[0-9\]+\.\[0-9\]+) was released"
Note that "\." in a tcl string expressed in double quotes is translated by tcl to "." so if you really want the regex engine to see "\." you need to either write "\\." inside the double-quoted string, or use curly brackets as your regex string encloser and then don't use backslashes in front of special tcl characters.
Either
livecheck.regex "Bazaar (\[0-9\]+\\.\[0-9\]+) was released"
or
livecheck.regex {Bazaar ([0-9]+\.[0-9]+) was released}
would be correct.
Thanks Ryan, thats very helpful. I always have problems with regular expressions. Cheers Adam
participants (2)
-
Adam Mercer
-
Ryan Schmidt