-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
bugSomething isn't workingSomething isn't working

Description
Describe the bug
Node.js version: v18.18.2
OS version: macOS 14.2.1
Description: If a valid protocol has extra characters preceding it, the extra characters are included in the match.
Actual behavior
urlRegexSafe({ strict: true }).exec("gaewggwhttp://localhost:3000/derp")
Produces a match that contains the entire string, including "gaewgg".
This also happens when strict is set to false.
Expected behavior
The match that is produced does not include "gaewgg"
Code to reproduce
const urlRegexSafe = require('url-regex-safe')
const match = urlRegexSafe({ strict: true }).exec("gaewggwhttp://localhost:3000/derp")
console.log(match)
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
Labels
bugSomething isn't workingSomething isn't working