[wpkg-users] [Bug 1] regular expressions are broken

bugzilla-daemon at wpkg.org bugzilla-daemon at wpkg.org
Mon Feb 27 13:52:06 CET 2006


Please reply using this URL only: http://bugs.wpkg.org/show_bug.cgi?id=1





------- Additional Comments From mangoo at mch.one.pl  2006-02-27 13:52 -------
Ironically, it's not a bug, but a feature.

Acording to this page:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/jscript7/html/jsjsgrpregexpsyntax.asp

^ Matches the position at the beginning of the input string.
$ Matches the position at the end of the input string.

So, you need to call a host "pc1$", and it will not match "pc101" anymore.

It is easy to wrap it in wpkg.js - just replace:

var reg = new RegExp(attrName, "i");

with:

var reg = new RegExp("^" + attrName + "$", "i"); 

It will add ^ at the beginning of each host, and $ at the end.

However, by making this, our syntax is no longer compatibile (but is easier to use).

Should I add it to WPKG to make life easier? Comments?

ideally would be of course to check if ^ and $ are used in the hostname, before
we add it on our own.

-- 
Configure bugmail: http://bugs.wpkg.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



wpkg-users mailing list
wpkg-users at lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users




More information about the wpkg-users mailing list