vdombrovski commented on PR #7671: URL: https://github.com/apache/cloudstack/pull/7671#issuecomment-1608119455
Okay, now I don't know if this project is AI-friendly, but here's a regexp generated with the help of GPT that will consistenly match all testcases except the one with a user but no password (e.g. `rbd://user@host` which to be honest might be a non-realistic test case). Tested against IPv4, RFC1035, IPv6 hosts, and base64 passwords. ``` String regex = "rbd:\\/\\/(?:(\\w+):([A-Za-z0-9+/=]+)@)?([\\[\\]:\\w.-]+)(?::(\\d+))?(?:\\/([\\w]+)(?:\\/([\\w]+))?)?"; ``` The capture groups (if they exist) will be as follows: ``` Capture Group 1: user Capture Group 2: password Capture Group 3: host Capture Group 4: 3300 Capture Group 5: pool Capture Group 6: volume2 ``` Please tell me if any use of AI is prohibited; I will delete this comment. -- 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]
