preg_match(): Compilation failed: invalid range in character class at offset

后端 未结 4 718
野的像风
野的像风 2020-11-22 15:31

Thank you in advance for you time in helping with this issue..

preg_match(): Compilation failed: invalid range in character class at offset 20 sessio

4条回答
  •  执念已碎
    2020-11-22 16:15

    Your error is dependent on your regex interpreter.

    You can escape hyphen to be clear about its use. Meaning using \- instead of -.

    Your final code:

    /^[a-z0-9]([0-9a-z_\-\s])+$/i
    

提交回复
热议问题