-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
--redirect: fix check for number of columns in redirect file #359
Conversation
Adjust to number of captures in previous regex
Not sure exactly what are the rationals behind both bug and fix. But this probably desserves a better automated testing. |
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.
Here's a valid redirect file
\tAccueil\tBienvenue !!\twelcome\n
\tAccueil2\t\tcommons48.png\n
\timage\t\tcommons48.png\n
Notice that it starts with a space and a tab \t
. That space was used by the (now unused) namespace.
We have support for it in scraperlib here with a test
As per the doc, size()
returns number of marked subexpressions plus 1
blame clearly shows that @mgautierfr changed the regexp 3y ago to remove the namespace but did not adjust the match count. scraperlib's implementation precedes the change.
Thanks @rgaudin for the investigation.
Is it really a valid file ? The regex search for 2 @haoess Please remove the merge commit of your own PR in your own @haoess It would be nice to have a testing of that code. Can you create it ? (It would probably need some refactoring of the code to separate the parsing of the file from adding the redirect) |
(Hopefully) done.
Sorry, I’m not a C++ dev. Applying some knowledge about how other languages handle captures in RE, using a pattern with three pairs of parens |
@mgautierfr please don't merge without automated test. |
No, I doesn't. The merge commit was the commit merging the change in your main. By reverting the merge commit, you removing the change. That's why we have 0 file changed. Anyway, I have create #360 which takes your commit and add the tests. |
No description provided.