Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: regEx definitions that used regex literal and separate flags #24626

Merged
merged 3 commits into from Sep 24, 2023

Conversation

gost-serb
Copy link
Contributor

Changes

Fix regEx definitions as described in this discussion

Also, add lastIndex reset in Conan data source getReleases otherwise it fails every second version.
Looks like re2 has the same behavior as native JS regExp:
I wonder why it wasn't caught by existing unit tests but I have the same behaviour on a real setup.
To reproduce the original bug execute the following code:

const RE2 = require('re2');

var r = new RE2(/foo/gim);
const samples = ['foo', 'foo42', 'aaafoo', 'bbbfoo', 'bbbfoo', 'cccfoo'];

for (x of samples) {
	console.log(x);
	console.log(r.exec(x));
}

Context

Closes #24622

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Also add `lastIndex` reset in conan datasource `getReleases`
otherwise it fails every second version.
@gost-serb gost-serb changed the title Fix regEx definitions that used regex literal and separate flags fix: regEx definitions that used regex literal and separate flags Sep 23, 2023
@rarkins rarkins added this pull request to the merge queue Sep 24, 2023
Merged via the queue into renovatebot:main with commit 6759c6f Sep 24, 2023
36 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 36.106.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gost-serb gost-serb deleted the regex-fix branch September 24, 2023 10:04
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants