r9413 - apps/gobi/trunk/code/Page

[email protected]
Newsgroups gmane.comp.java.helma.cvs
Message-ID <[email protected]>
Author: hannes
Date: 2008-12-11 14:58:38 +0100 (Thu, 11 Dec 2008)
New Revision: 9413

Modified:
   apps/gobi/trunk/code/Page/PageMacros.js
Log:
Use RegExp.test() instead of String.match() and don't make regexp global.

Details at http://dev.helma.org/trac/helma/changeset/9413

Modified: apps/gobi/trunk/code/Page/PageMacros.js
===================================================================
--- apps/gobi/trunk/code/Page/PageMacros.js	2008-12-11 13:42:56 UTC (rev 9412)
+++ apps/gobi/trunk/code/Page/PageMacros.js	2008-12-11 13:58:38 UTC (rev 9413)
@@ -300,9 +300,9 @@
         
     var list = this.list();
     if (param.pattern) {
-        var regexp = new RegExp(param.pattern, "gi");
+        var regexp = new RegExp(param.pattern, "i");
         list = list.filter(function(elem) {
-            return elem.name && elem.name.match(regexp);
+            return elem.name && regexp.test(elem.name);
         })
     }
     if (param.skin || param.separator) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.