diff scripts/pkg/get_forge_pkg.m @ 11032:c9b0a75b02e8

Make all regexp in Octave compatible with both POSIX and PCRE.
author Rik <octave@nomad.inbox5.com>
date Tue, 28 Sep 2010 09:25:14 -0700
parents 4f46520e2103
children 2c356a35d7f5
line wrap: on
line diff
--- a/scripts/pkg/get_forge_pkg.m
+++ b/scripts/pkg/get_forge_pkg.m
@@ -41,8 +41,8 @@
     ## Remove blanks for simpler matching.
     html(isspace(html)) = [];
     ## Good. Let's grep for the version.
-    pat = "<tdclass=""package_table"">PackageVersion:</td><td>([0-9\\.]*)</td>";
-    [~, ~, ~, ~, t] = regexp (html, pat);
+    pat = "<tdclass=""package_table"">PackageVersion:</td><td>([0-9.]*)</td>";
+    t = regexp (html, pat, "tokens");
     if (isempty (t) || isempty(t{1}))
       error ("get_forge_pkg: could not read version number from package's page.");
     else
@@ -61,7 +61,7 @@
     ## Try get the list of all packages.
     [html, succ] = urlread ("http://octave.sourceforge.net/packages.php");
     if (succ)
-      [~, ~, ~, ~, t] = regexp (html, "<div class=""package"" id=""(\\w+)"">");
+      t = regexp (html, "<div class=""package"" id=""(\\w+)"">", "tokens");
       t = horzcat (t{:});
       if (any (strcmp (t, name)))
         error ("get_forge_pkg: package name exists, but index page not available");