gxthrj commented on issue #1639: URL: https://github.com/apache/apisix-dashboard/issues/1639#issuecomment-803791162
Great~ but I think https://projects.lukehaas.me/regexhub/ is not enough. Maybe regex does have some standards or best practices, but meeting our needs is the most important thing. We can only refer to the examples you give. For example, we need regex-expr for ` ipv4` and `domain`, but it is only `ipv4`. ``` // now what we use (^([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5])(\.(25[0-5]|1\d{2}|2[0-4]\d|[1-9]?\d)){3}$|^(?![0-9.]+$)([a-zA-Z0-9_-]+)(\.[a-zA-Z0-9_-]+){0,}$) ``` ``` // which is in lukehaas.me /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/ ``` Another example about usename. We also need to support Chinese. ``` // now what we use is better ^[a-zA-Z\u4e00-\u9fa5][a-zA-Z0-9\u4e00-\u9fa5_-]{1,100}$ ``` -- 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. For queries about this service, please contact Infrastructure at: [email protected]
