[Webkit-unassigned] [Bug 9234] New: Implement $&, $' and $` replacement codes in String.prototype.replace

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Fri Jun 2 08:42:24 PDT 2006


http://bugzilla.opendarwin.org/show_bug.cgi?id=9234

           Summary: Implement $&, $' and $` replacement codes in
                    String.prototype.replace
           Product: WebKit
           Version: 420+ (nightly)
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at opendarwin.org
        ReportedBy: opendarwin.org at mitzpettel.com
                CC: ggaren at apple.com
OtherBugsDependingO 9205
             nThis:


According to Ecma-262 15.5.4.11, if replaceValue is a string, then $& should be
replaced with the matched substring, $` with everything preceding the matched
substring, and $' with everything following the matched substring. For example,

"abcdefg".replace(/d(e)/, "[$&]") == "abc[de]fg" (currently achievable using
$0)
"abcdefg".replace(/d(e)/, "[$`]") == "abc[abc]fg"
"abcdefg".replace(/d(e)/, "[$']") == "abc[fg]fg"


-- 
Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list