Repository navigation
Conversation
|
Two failed checks seems to be unrelated. |
There was a problem hiding this comment.
This cannot be correct, since it puts the wrong part into $1.
Why not just extend the pattern? Surely it doesn't do any false positive matches elsewhere?
if(/(CURL_DISABLE_[A-Z0-9_]+)/g) {There was a problem hiding this comment.
Nope. :)
It is non-capturing group because of ?:
(?:^|[^A-Za-z0-9\-]) is matched but not captured.
The same for (?:$|[^A-Za-z0-9\-]).
It works correctly, I tested it with modified script version with printing all matched results.
Right now there are no false positives here even without the start and end patterns. But this is the test, it must catch incorrect code changes.
There was a problem hiding this comment.
Ok thanks, that goes beyond what I knew. I still think it's overly complicated for no good reason.
There was a problem hiding this comment.
It works as well.
I don't create PRs without proper local testing.
I added debug printing of the results and results are fine.
There was a problem hiding this comment.
This one is correct too.
|
@bagder The code works correctly. Let me know, please, if you still think that code should be simplified by removing non-capturing groups. |
19a4c36 to
bb220d3
Compare
|
Force-pushed with correct commit text (and rebased) |
I think so. The regexes should be as simple as possible to help readers understand then. |
* Fix excluded digits at the end of the symbols ('CURL_DISABLE_POP3'
was checked as 'CURL_DISABLE_POP')
bb220d3 to
1efdf80
Compare
|
Updated with non-capturing groups removed, as requested. |
|
Two build failures seem to be unrelated. |
|
Thanks! |
CURL_DISABLE_POP3was checked asCURL_DISABLE_POP)Discovered while working on PR #12897