Bug 3450 - String.replace() method not working when regex pattern contains {n, m}
Summary: String.replace() method not working when regex pattern contains {n, m}
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 412
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Maciej Stachowiak
Depends on:
Reported: 2005-06-11 17:44 PDT by Stuart Morgan
Modified: 2005-07-03 07:53 PDT (History)
0 users

See Also:

Testcase (1.71 KB, text/html)
2005-06-11 17:44 PDT, Stuart Morgan
no flags Details
Fix bug (2.16 KB, patch)
2005-06-20 06:17 PDT, Anders Carlsson
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Morgan 2005-06-11 17:44:27 PDT
The string.replace() method fails with regexes that use {n,m} style ranges.

Apple Bug: rdar://3881901
Comment 1 Stuart Morgan 2005-06-11 17:44:47 PDT
Created attachment 2257 [details]
Comment 2 Anders Carlsson 2005-06-20 06:17:06 PDT
Created attachment 2496 [details]
Fix bug

There is a problem with the length calculation in pcre_compile which makes some
ranges not work when using UTF-16. This patch solves the problem similarly to
how never versions of pcre solves it with UTF-8.
Comment 3 Darin Adler 2005-06-20 08:40:56 PDT
Our PCRE is based on version 3.9, and the latest is 5.0. Should we also merge in a newer PCRE?
Comment 4 Darin Adler 2005-06-20 08:45:10 PDT
Comment on attachment 2496 [details]
Fix bug