WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WORKSFORME
51206
grouping regexp matching incorrectly
https://bugs.webkit.org/show_bug.cgi?id=51206
Summary
grouping regexp matching incorrectly
Chris Dent
Reported
2010-12-16 12:30:26 PST
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.
Attachments
reduction of the problem
(590 bytes, text/plain)
2010-12-16 12:31 PST
,
Chris Dent
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Chris Dent
Comment 1
2010-12-16 12:31:56 PST
Created
attachment 76799
[details]
reduction of the problem
Alexey Proskuryakov
Comment 2
2010-12-17 12:34:06 PST
> If you compare the resulting page in webkit nightly with Firefox you'll see the issue.
I don't see a difference between
r74228
and Firefox 3.6.13. Running the reduce test case also gives identical results: ----------------------- HelloThere undefined undefined undefined undefined undefined undefined "How did you first discover TiddlyWiki?" undefined "tag" "band" undefined undefined undefined undefined "What was it about TiddlyWiki that captured your interest?" undefined undefined undefined "Which aspects of TiddlyWiki do you find most valuable?" null ----------------------- Please re-open with more information if you can still observe the problem with the latest nightly.
Chris Dent
Comment 3
2010-12-17 12:47:09 PST
Worksforme now too, since getting 74228. I was on 73886. I'm assuming this was the fix
http://trac.webkit.org/changeset/73962
? Thanks.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug