Skip to content

Support closing parentheses in URLs do not match #30

Open
@michelnev

Description

@michelnev

Describe the bug

Node.js version: v20.9.0

OS version: FreeBSD freebsd 13.2-RELEASE-p4

Description: URL with ) characters are not matched.

Actual behavior

Testing with an exact match against a url like http://foo.com/blah_blah_(wikipedia) returns false.

Expected behavior

Testing with an exact match against a URL like http://foo.com/blah_blah_(wikipedia) should return true.

Code to reproduce

const urlRegex = require( 'url-regex-safe' );

const s0 = 'http://foo.com/blah_blah_(wikipedia';
const s1 = 'http://foo.com/blah_blah_(wikipedia)';

// Returns true as expected
console.log(urlRegex({exact: true}).test(s0));

// Should be true, but return false
console.log(urlRegex({exact: true}).test(s1));

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions