Bug 230038 - Incorrect matching of regular expressions
Summary: Incorrect matching of regular expressions
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-08 01:13 PDT by Yeting Li
Modified: 2021-09-15 01:14 PDT (History)
3 users (show)

See Also:


Attachments
demo code (55 bytes, text/javascript)
2021-09-08 01:13 PDT, Yeting Li
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yeting Li 2021-09-08 01:13:12 PDT
Created attachment 437607 [details]
demo code

For some regexes with backreferences and optional groupings, for example, the regex /(a)?(b)\1/ should not match the string "b", but JavaScriptCore determines the regex /(a)?(b)\1/ matching the string "b".
  

It should be pointed out that the semantics of the regex /(a)?(b)\1/ and the regex /(a?)(b)\1/ are different. Specifically, the regex /(a)?(b)\1/ does not match the string "b", and the regex /(a?)(b)\1/ matches the string "b".
Comment 1 Radar WebKit Bug Importer 2021-09-15 01:14:24 PDT
<rdar://problem/83135746>