<?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>21414</bug_id>
          
          <creation_ts>2008-10-06 15:49:47 -0700</creation_ts>
          <short_desc>REGRESSION: Regular Expressions and character classes, shorthands and ranges</short_desc>
          <delta_ts>2009-02-02 22:09:15 -0800</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>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Bernd Lutz">iberndlu</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ggaren</cc>
    
    <cc>gianni</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>94285</commentid>
    <comment_count>0</comment_count>
    <who name="Bernd Lutz">iberndlu</who>
    <bug_when>2008-10-06 15:49:47 -0700</bug_when>
    <thetext>JavaScript has some difficulties with character classes and shorthands like &quot;\w&quot; while using a hyphen as hyphen in a range.

JS example: &apos;hello_there&apos;.replace(/[\w\-]+/, &apos;xxx&apos;)
This should return the string &quot;xxx&quot; like in Safari 3.1.2 or Firefox 3.x. The current WebKit Build returns &quot;xxx_there&quot; because the character class shorthand \w seems not to include the underscore anymore. Removing the &quot;\-&quot; of the range fixes the bug.

For some reasons you cannot simply place a underscore within a character class to fix the erratic behaviour related to the \w shorthand. The underscore must be escaped (this is normally not necessary).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107701</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-01-30 08:40:04 -0800</bug_when>
    <thetext>Giving this full regression treatment. On IRC, it was mentioned that the issue is still present in current nightlies (I haven&apos;t tried to reproduce it).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107706</commentid>
    <comment_count>2</comment_count>
      <attachid>27183</attachid>
    <who name="Gianni Chiappetta">gianni</who>
    <bug_when>2009-01-30 09:08:14 -0800</bug_when>
    <thetext>Created attachment 27183
This is a test case for the bug which provides an example.

Provides a quick example of the bug with actual results and expected results.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107707</commentid>
    <comment_count>3</comment_count>
    <who name="Gianni Chiappetta">gianni</who>
    <bug_when>2009-01-30 09:09:25 -0800</bug_when>
    <thetext>I&apos;ve come across this bug while testing scripts in the latest nightly. I&apos;ve added a test case to illustrate the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107710</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-01-30 09:20:48 -0800</bug_when>
    <thetext>Confirmed with r40407.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107712</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-01-30 09:21:38 -0800</bug_when>
    <thetext>&lt;rdar://problem/6543487&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108086</commentid>
    <comment_count>6</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2009-02-02 22:09:15 -0800</bug_when>
    <thetext>Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	JavaScriptCore/ChangeLog
	M	JavaScriptCore/wrec/WRECGenerator.cpp
	M	LayoutTests/ChangeLog
	A	LayoutTests/fast/js/regexp-character-match-out-of-order-expected.txt
	A	LayoutTests/fast/js/regexp-character-match-out-of-order.html
	A	LayoutTests/fast/js/resources/regexp-character-match-out-of-order.js
Committed r40522</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>27183</attachid>
            <date>2009-01-30 09:08:14 -0800</date>
            <delta_ts>2009-01-30 09:08:14 -0800</delta_ts>
            <desc>This is a test case for the bug which provides an example.</desc>
            <filename>webkit_bug.html</filename>
            <type>text/html</type>
            <size>1231</size>
            <attacher name="Gianni Chiappetta">gianni</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjAgVHJhbnNpdGlvbmFs
Ly9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL3hodG1sMS9EVEQveGh0bWwxLXRyYW5zaXRpb25h
bC5kdGQiPgo8aHRtbCBsYW5nPSJlbiIgeG1sOmxhbmc9ImVuIiB4bWxucz0iaHR0cDovL3d3dy53
My5vcmcvMTk5OS94aHRtbCI+CjxoZWFkPgoJPHRpdGxlPldlYmtpdCBCdWcgIzIxNDE0PC90aXRs
ZT4KCTxtZXRhIGh0dHAtZXF1aXY9IkNvbnRlbnQtVHlwZSIgY29udGVudD0iYXBwbGljYXRpb24v
eGh0bWwreG1sOyBjaGFyc2V0PXV0Zi04IiAvPgo8L2hlYWQ+Cgo8Ym9keT4KCjxoMT5XZWJraXQg
QnVnICMyMTQxNDwvaDE+Cgo8aDI+UXVpY2sgRGVzY3JpcHRpb248L2gyPgo8cD4KICBJdCBzZWVt
cyB0aGF0IDxzdHJvbmc+XHc8L3N0cm9uZz4gY2hhcmFjdGVyIGNsYXNzIGluIHJlZ3VsYXIgZXhw
cmVzc2lvbnMgaXNuJ3QgaW5jbHVkaW5nIDxzdHJvbmc+Xzwvc3Ryb25nPiAodW5kZXJzY29yZSkg
d2hlbiBvdGhlciBj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