esamattis / esamattis/underscore.string

trim does not handle dashes

Open
#209 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.4k
Forks
367
PR merge metrics
No merged PRs in 30d

Description

ltrim("https://www.lw-qa-3.x.net", "https://www.lw-qa-3.x.net")

blows up with the following error:

SyntaxError: Invalid regular expression: /^[https:\/\/www.lw-qa-3.x.net:80]+/: Range out of order in character class

This is because the function "escapeRegExp" does not escape dashes (-)

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.