RESOLVED DUPLICATE of bug 18327 21485
URL regular expression fails on long strings
https://bugs.webkit.org/show_bug.cgi?id=21485
Summary URL regular expression fails on long strings
Patrick Johnson
Reported 2008-10-08 14:32:42 PDT
The following regular expression fails if given a string longer than 450 characters: /^((\w+):\/\/)(([^:]+):?([^@]+)?@)?([^\/\?:]*):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(.+)?/ This regex is used by the Selenium project to determine whether a string is a valid URL. I have observed this in Safari 3.1.2 (on Windows) and Google Chrome/Chromium. This is very possibly the same as: https://bugs.webkit.org/show_bug.cgi?id=18327
Attachments
Test case (1.06 KB, text/html)
2008-10-08 14:42 PDT, Patrick Johnson
no flags
Mark Rowe (bdash)
Comment 1 2008-10-08 14:35:21 PDT
Patrick Johnson
Comment 2 2008-10-08 14:42:49 PDT
Created attachment 24201 [details] Test case
Barry Ferg
Comment 3 2009-03-03 09:04:14 PST
*** Bug 24308 has been marked as a duplicate of this bug. ***
Levin Alexander
Comment 4 2009-03-16 11:20:38 PDT
saw something that seems to be the same bug: the ExtJs framework has a regular expression to validate email addresses: var mailrx = /^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/; using this regular expression causes the following test cases to fail in Webkit Nightlies and the Safari 4 beta testRegularExpressionMatching: function() { this.assert("info@exactlytwentycharac.com".match(mailrx)); /* fails */ this.assert("info@lessthantwentychar.com".match(mailrx)); /* passes */ this.assert("info@foo.lessthantwentychars.de".match(mailrx)); /* fails */ }, (This is on OS X 10.5 with all updates, the Safari 4 beta installed and using WebKit r41707)
Geoffrey Garen
Comment 5 2009-03-19 15:06:38 PDT
*** This bug has been marked as a duplicate of 18327 ***
Note You need to log in before you can comment on or make changes to this bug.