<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>21485</bug_id>
          
          <creation_ts>2008-10-08 14:32:42 -0700</creation_ts>
          <short_desc>URL regular expression fails on long strings</short_desc>
          <delta_ts>2009-03-19 15:06:38 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>18327</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Patrick Johnson">patrick</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>barryferg+webkit</cc>
    
    <cc>mail</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>94619</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Johnson">patrick</who>
    <bug_when>2008-10-08 14:32:42 -0700</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94622</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-10-08 14:35:21 -0700</bug_when>
    <thetext>&lt;rdar://problem/6279213&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94623</commentid>
    <comment_count>2</comment_count>
      <attachid>24201</attachid>
    <who name="Patrick Johnson">patrick</who>
    <bug_when>2008-10-08 14:42:49 -0700</bug_when>
    <thetext>Created attachment 24201
Test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112005</commentid>
    <comment_count>3</comment_count>
    <who name="Barry Ferg">barryferg+webkit</who>
    <bug_when>2009-03-03 09:04:14 -0800</bug_when>
    <thetext>*** Bug 24308 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113897</commentid>
    <comment_count>4</comment_count>
    <who name="Levin Alexander">mail</who>
    <bug_when>2009-03-16 11:20:38 -0700</bug_when>
    <thetext>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(&quot;info@exactlytwentycharac.com&quot;.match(mailrx));    /* fails */    
    this.assert(&quot;info@lessthantwentychar.com&quot;.match(mailrx));     /* passes */
    this.assert(&quot;info@foo.lessthantwentychars.de&quot;.match(mailrx)); /* fails */
  },

(This is on OS X 10.5 with all updates, the Safari 4 beta installed and using WebKit r41707)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114385</commentid>
    <comment_count>5</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2009-03-19 15:06:38 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of 18327 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>24201</attachid>
            <date>2008-10-08 14:42:49 -0700</date>
            <delta_ts>2008-10-08 14:42:49 -0700</delta_ts>
            <desc>Test case</desc>
            <filename>long_string_url_regexp.html</filename>
            <type>text/html</type>
            <size>1082</size>
            <attacher name="Patrick Johnson">patrick</attacher>
            
              <data encoding="base64">PGh0bWw+CiAgPHNjcmlwdD4KICAgIHZhciByZWdleCA9IC9eKChcdyspOlwvXC8pKChbXjpdKyk6
PyhbXkBdKyk/QCk/KFteXC9cPzpdKik6PyhcZCspPyhcLz9bXlw/I10rKT9cPz8oW14jXSspPyM/
KC4rKT8vOwoKICAgIGZ1bmN0aW9uIHRlc3RVcmwodXJsKSB7CiAgICAgIHZhciByZXN1bHQgPSBy
ZWdleC5leGVjKHVybCk7CiAgICAgIGlmIChyZXN1bHQpIHsKICAgICAgICBkb2N1bWVudC5nZXRF
bGVtZW50QnlJZCgidGVzdCIpLmlubmVySFRNTCArPSAiPGJyIC8+cGFzc2VkLCBsZW5ndGg9IiAr
IHVybC5sZW5ndGg7CiAgICAgIH0gZWxzZSB7CiAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5
SWQoInRlc3QiKS5pbm5lckhUTUwgKz0gIjxiciAvPmZhaWxlZCwgbGVuZ3RoPSIgKyB1cmwubGVu
Z3RoOwogICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gcnVuVGVzdCgpIHsKICAgICAgdmFyIHN0
cjEgPSAnaHR0cDovL3d3dy5leGFtcGxlLmNvbS8wMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3
ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0
NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAx
MjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3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