Skip to content

RegEx unicode mismatch? #26785

@jsg2021

Description

@jsg2021

What version of Bun is running?

1.3.8

What platform is your computer?

macos

What steps can reproduce the bug?

save this to a file: test.js and just bun test ./test.js

This works on node.

const R =
	/[½¼¾]|([¹²³]+|[]+|[0-9]+)([\/\⁄])([¹²³]+|[]+|[0-9]+)/;

test('should match fraction, () => {
	const m = '³⁄₅₂ cup of stuff'.match(R);
	expect(m).toMatchInlineSnapshot(`
[
  "³⁄₅₂",
  "³",
  "⁄",
  "₅₂",
]
`);
});

What is the expected behavior?

The regex should match

What do you see instead?

null

Additional information

see code sample

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions