facebook / facebook/hermes

Regex bug

Open
#896 7 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
11.3k
Forks
859
Avg merge
1h 30m
Merged PRs (30d)
3

Description

## Bug Description
Hermes version: 0.12.0
OS version (if any): ubuntu 20.04
Hi. The code below does not have the same behavior as other engines (e.g., V8 in Google Chrome,SpiderMonkey in Firefox,chakra in Edge,quickjs,jerryscript). This test case works correctly in other js engines with returning a matched result, but in hermes return null.

## Steps To Reproduce
1.var regex=/((?:(?:|[A-Z])((?:n*.)){1}))+(?:\2\2*)/;
2.regex.exec("NnnX")

![image](https://user-images.githubusercontent.com/50438846/213369737-3c436403-43db-4053-8ed9-404fd2346eaa.png)

## The Expected Behavior
[ "Nnn", "n", "n" ]

![image](https://user-images.githubusercontent.com/50438846/213377356-d63e7893-f7b0-4322-a0dd-7bb36fcbd124.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.