Regex#test() matches the pattern anywhere in the string, but often the
intent is to only match the entire string. Such as on line 113 linked below.
http://code.google.com/p/rdfquery/source/browse/trunk/jquery.rdfa.js#113
The regex expressions should be changed to use ^ and $ symbols to match the
entire string.
The correct usage should be something like:
/^about$|^href$|^src$|^resource$|^property$|^typeof$|^content$|^datatype$/.test(
a.nodeName)
Original issue reported on code.google.com by james-no...@leighnet.ca on 2 Nov 2009 at 3:13
Original issue reported on code.google.com by
james-no...@leighnet.ca
on 2 Nov 2009 at 3:13