You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/03/22 03:47:09 UTC

[GitHub] [apisix-dashboard] gxthrj opened a new issue #1639: feat: Improve the regexp, reference some standard projects

gxthrj opened a new issue #1639:
URL: https://github.com/apache/apisix-dashboard/issues/1639


   Now, we use `jsonschema` to verfiy the fields of objects.
   
   As @juzhiyuan suggested, Need to modify regexp refer to some standard projects . 
   
   For example, verify fields such as name, password, email. This can avoid some mistakes.


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on issue #1639: feat: Improve the regexp, reference some standard projects

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #1639:
URL: https://github.com/apache/apisix-dashboard/issues/1639#issuecomment-803760969


   ya, here have some examples: https://projects.lukehaas.me/regexhub/
   
   and @LiteSun, could you help to provide some rules from and?


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] LiteSun commented on issue #1639: feat: Improve the regexp, reference some standard projects

Posted by GitBox <gi...@apache.org>.
LiteSun commented on issue #1639:
URL: https://github.com/apache/apisix-dashboard/issues/1639#issuecomment-804523341


   > ya, here have some examples: https://projects.lukehaas.me/regexhub/
   > 
   > and @LiteSun, could you help to provide some rules from antd?
   
   ANTD uses the [async-validator](https://github.com/yiminghe/async-validator) library for field checking, if you want to see the regular rules you need to look through the source code, which is not very convenient


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan edited a comment on issue #1639: feat: Improve the regexp, reference some standard projects

Posted by GitBox <gi...@apache.org>.
juzhiyuan edited a comment on issue #1639:
URL: https://github.com/apache/apisix-dashboard/issues/1639#issuecomment-803760969


   ya, here have some examples: https://projects.lukehaas.me/regexhub/
   
   and @LiteSun, could you help to provide some rules from antd?


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on issue #1639: feat: Improve the regexp, reference some standard projects

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #1639:
URL: https://github.com/apache/apisix-dashboard/issues/1639#issuecomment-803756434


   Hello, please have this issue tagged :)


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] gxthrj commented on issue #1639: feat: Improve the regexp, reference some standard projects

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] gxthrj commented on issue #1639: feat: Improve the regexp, reference some standard projects

Posted by GitBox <gi...@apache.org>.
gxthrj commented on issue #1639:
URL: https://github.com/apache/apisix-dashboard/issues/1639#issuecomment-803741783


   Hi, guys.
   
   Are there any good reference projects? Please list them here. I have searched many projects on github.
   But there are no standard, only different needs. 
   
   There are some regular libraries, but the regular expressions still need to be filled in by yourself.
   
   


-- 
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:
users@infra.apache.org