Conversation
| public class RegexUtils { | ||
|
|
||
| private static final Pattern LINUX_USERNAME_PATTERN = Pattern.compile("^[a-zA-Z0-9_].{0,30}"); | ||
| private static final Pattern LINUX_USERNAME_PATTERN = Pattern.compile("[a-zA-Z_][a-zA-Z\\d_-]{0,30}"); |
There was a problem hiding this comment.
| private static final Pattern LINUX_USERNAME_PATTERN = Pattern.compile("[a-zA-Z_][a-zA-Z\\d_-]{0,30}"); | |
| private static final Pattern LINUX_USERNAME_PATTERN = Pattern.compile("[a-zA-Z\\d_-].{0,30}"); |
There was a problem hiding this comment.
Could you please add ut for this?
There was a problem hiding this comment.
I think only '-' matches [a-zA-Z\d_-].{0,30}, pure numbers are also matches [a-zA-Z\d_-].{0,30}; such as '-', 123456; but these are not valid linux user names!
There was a problem hiding this comment.
Looking forward to your reply and suggestions
There was a problem hiding this comment.
regex would not failed with 10000, but 10000 is not a valid linux user name
There was a problem hiding this comment.
Please fix the UT
RegexUtilsTest.testIsValidLinuxUserName
There was a problem hiding this comment.
Could you add me wechat or call me, I want to ask you a question? 15651806509
There was a problem hiding this comment.
Could you add me wechat or call me, I want to ask you a question? 15651806509
It is better to keep it public so that others can participate in the review.
|
This pull request has been automatically marked as stale because it has not had recent activity for 120 days. It will be closed in 7 days if no further activity occurs. |
|
This pull request has been closed because it has not had recent activity. You could reopen it if you try to continue your work, and anyone who are interested in it are encouraged to continue work on this pull request. |
Purpose of the pull request
Brief change log
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(or)
If your pull request contain incompatible change, you should also add it to
docs/docs/en/guide/upgrede/incompatible.md