[Webkit-unassigned] [Bug 51206] New: grouping regexp matching incorrectly
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Dec 16 12:30:26 PST 2010
https://bugs.webkit.org/show_bug.cgi?id=51206
Summary: grouping regexp matching incorrectly
Product: WebKit
Version: 528+ (Nightly build)
Platform: Macintosh Intel
URL: http://interview.tiddlyspace.com/
OS/Version: Mac OS X 10.6
Status: UNCONFIRMED
Severity: Normal
Priority: P2
Component: JavaScriptCore
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: chris.dent at gmail.com
At the above URL some JavaScript is used to determine which items to display. If you compare the resulting page in webkit nightly with Firefox you'll see the issue.
I've reduced this down to this code (also attached), which will produce different results when run in the consoles of nightlies or Firefox (it can also be run, returning the correct results, against node.js):
-=-=-
var text = "HelloThere\n\
[[How did you first discover TiddlyWiki?]]\n\
[tag[band]]\n\
[[What was it about TiddlyWiki that captured your interest?]]\n\
[[Which aspects of TiddlyWiki do you find most valuable?]]\n\
"
// This one does not work in webkit's console.
var re = /([^\s\[\]]+)|(?:\[([\w]+)\[([^\]]+)\]\])|(?:\[\[([^\]]+)\]\])/mg;
// This one works in webkit's console.
//var re = /([^\s\[\]]+)|(?:\[\[([^\]]+)\]\])|(?:\[([\w]+)\[([^\]]+)\]\])/mg;
var match = re.exec(text);
while (match) {
console.log(match[1], match[2], match[3], match[4]);
match = re.exec(text);
}
-=-=-
Changing the ordering of group in re to be like the second re in the snippet gets the expected results, so that's perhaps a clue.
This is a regression of some kind, likely within the last two or three weeks or so.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list