- Notifications
You must be signed in to change notification settings - Fork146
Fixes option parsing on C++ libs that match EOL differently#136
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
As explained inhttps://stackoverflow.com/questions/39645660/stdregex-to-match-begin-end-of-string this helps when running on c++ libraries that do not match EOL with $.
ttuggle commentedJul 27, 2020
FYI, this does include the code from#109 |
ttuggle commentedJul 27, 2020
The pull request in#109 fixes problems parsing something like this, which does parse in Python. |
| "(?:^|\\n)"// anchored at a linebreak (or start of string) | ||
| "(" | ||
| "[^\\n]*" + name +"[^\\n]*(?=\\n?)"// a line that contains the name | ||
| "(?:\\n[\\t].*?(?=\\n|$))*"// followed by any number of lines that are indented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Is the issue that it won't matchjust a newline (without spaces)?
| } | ||
| staticconst std::regex pattern {"(-{1,2})?(.*?)([,= ]|$)"}; | ||
| staticconst std::regex pattern {"(-{1,2})?(.*?)([,= ]|$|\n)"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The|$ should match a newline right?
The following fragment does not match between docopt.cpp and docopt: