Regex allow a string to only contain numbers 0 - 9 and limit length to 45

后端 未结 8 842
轮回少年
轮回少年 2020-12-02 13:57

I am trying to create a regex to have a string only contain 0-9 as the characters and it must be at least 1 char in length and no more than 45. so

8条回答
  •  悲&欢浪女
    2020-12-02 14:33

    Rails doesnt like the using of ^ and $ for some security reasons , probably its better to use \A and \z to set the beginning and the end of the string

提交回复
热议问题