Skip to content

Avoid mistaken character class in pattern regex#70

Open
DrRoach wants to merge 1 commit intosunra:masterfrom
DrRoach:patch-1
Open

Avoid mistaken character class in pattern regex#70
DrRoach wants to merge 1 commit intosunra:masterfrom
DrRoach:patch-1

Conversation

@DrRoach
Copy link

@DrRoach DrRoach commented Apr 25, 2019

This pattern:

([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)["']?(.*?)["']?)?\])?([\/, ]+)

Treats the - in both the character groups as ranges rather than characters to match meaning that the regex is looking for everything including and between \w-: rather than the three characters by themselves. The same issue is repeated near the middle of the regex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant