xrl1 commented on PR #5057:
URL: https://github.com/apache/iceberg/pull/5057#issuecomment-1164153523
@szehon-ho I'll explain a little bit more:
As requested, I used a multi-line regex search as asked, and I set
`matchAcrossLines` to `true` to enable "DOTALL flag" as we don't know on which
line the "%d" expression will appear after the function call.
Once this value is set, if I insert `.*` before the `%d` in the expression
(to match the first argument to `checkArgument`, and not only to skip `%d` in
it as you asked), it will search for matches for the second part of the regex,
in all the file, even after checkArugment statement.
For example:
```
Preconditions.checkArgument(partitionFields.size() >= 1, "some text %s", 1);
someOtherFunc("%d", 100);
```
might be mistakenly matched.
To avoid matching it, the `[^;]` will terminate the search upon the first
`;` it encounters, and problem solved.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]