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
<rdar://problem/6279213>
Created attachment 24201 [details] Test case
*** Bug 24308 has been marked as a duplicate of this bug. ***
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)
*** This bug has been marked as a duplicate of 18327 ***