Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Be more resctrictive with regexp matches #1
@nvtkaszpir Would you mind helping me through this?
This is what I know:
This is what I don't know:
I found a correct test, and it used:
I understand that it specifies:
But I don't understand what the
See about Regexp Extensions
? means zero or more matches.
Notice, that regexp, which I suggested, does not allow for comments in the line.
After some fiddling I think it is better to use other methods (for example ini or parse_config) which does that exciting regexp matching for you. I'm really trying to avoid regexp if possible, it makes my eyes bleed :). Too many regexp entries just make reading the code much harder, see how difficult is to find 'gpgcheck=1' in my initial regexp. It would be better to get the gpgcheck value (for example using parse_config), and check if it is in allowed value range, which is AFAIR 0 and 1.