Bug 259536 - Positive look-behind RegExp doesn't match in JSC but does match in V8
Summary: Positive look-behind RegExp doesn't match in JSC but does match in V8
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Saboff
URL: https://github.com/oven-sh/bun/issues...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-07-26 15:53 PDT by Jarred Sumner
Modified: 2023-08-15 08:59 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jarred Sumner 2023-07-26 15:53:24 PDT
Reproduction:
```
const print = globalThis.print ?? console.log;
const re =
  /(?<=^v?|\sv?)(?:(?:0|[1-9]\d{0,9}?)\.){2}(?:0|[1-9]\d{0,9})(?:-(?:--+)?(?:0|[1-9]\d*|\d*[a-z]+\d*)){0,100}(?=$| |\+|\.)(?:(?<=-\S+)(?:\.(?:--?|[\da-z-]*[a-z-]\d*|0|[1-9]\d*)){1,100}?)?(?!\.)(?:\+(?:[\da-z]\.?-?){1,100}?(?!\w))?(?!\+)/;
const res = re.exec("v1.0.1448");
print(res);
```

`res` is null in jsc shell

In Node, `res` is:

```
[ '1.0.1448', index: 1, input: 'v1.0.1448', groups: undefined ]
```

This is running on a build of JSC from July 23rd
Comment 1 Radar WebKit Bug Importer 2023-07-26 20:44:37 PDT
<rdar://problem/112952197>
Comment 2 Michael Saboff 2023-08-14 18:21:51 PDT
Pull request: https://github.com/WebKit/WebKit/pull/16694
Comment 3 EWS 2023-08-15 08:58:59 PDT
Committed 266912@main (caa31552bab4): <https://commits.webkit.org/266912@main>

Reviewed commits have been landed. Closing PR #16694 and removing active labels.