Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wildcarding not working properly against content with asterisks #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cjfritz
Copy link
Collaborator

@cjfritz cjfritz commented Apr 10, 2019

Problem:
When a target with unescaped asterisks is matched against a source with escaped asterisks, the source asterisks that are escaped will not match with the asterisks in the target, since '\\*' != '*'. Within the source, asterisks not within the wildcard structure {{*}} must be escaped so they may be ignored by the Matcher object, but will not match with the original unescaped asterisks that they are intended to match.
Solution:
Escape the asterisks within the target as well so '\\*' == '\\*'. Avoid breaking other functionality by checking if the target is undefined or null before generating a new string containing escaped asterisks.
Several tests were added to make sure regular asterisks could be matched, and they did not function as special characters within the Matcher.

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