-
Notifications
You must be signed in to change notification settings - Fork 70
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
Match expressions for license templates fail when using white space #130
Comments
Can't we fix this here (vs. in license-list-XML) by adjusting the license regexps if necessary? I'd rather not break the XML to work around a tooling issue. |
I would also like to fix this in the tools, however, it looks like a major design change that would cause a significant performance problem. If you have an idea how to fix without a major design change, please propose the details as a comment or do a PR. |
For the handful of license-list-XML cases, you could replace |
In the case where you have white space involved in the matching, I would prefer to update the license list XML matches to include the words surrounding the white space in the match. It is more precise and efficient. For examples, to match |
On Wed, Dec 27, 2017 at 05:12:36AM +0000, goneall wrote:
In the case where you have white space involved in the matching, I
would prefer to update the license list XML matches to include the
words surrounding the white space in the match. It is more precise
and efficient.
More efficient, possibly (I could see this going either way). But I
don't see how including non-variable text in the regular expression
would make things more precise.
|
When there is a white space used in a pattern for the
<<var
expression in a license template, it will sometimes not match.This is due to the license text being tokenized as part of the match.
It fails specifically if the space is at the very end of text to be matched. The space will be trimmed off of the comparison text causing the failure.
A workaround is to use the optional keyword (e.g. " |" -> " ?|").
The text was updated successfully, but these errors were encountered: