Alphanumeric, dash and underscore but no spaces regular expression check JavaScript

前端 未结 7 586
忘掉有多难
忘掉有多难 2020-12-23 10:48

Trying to check input against a regular expression.

The field should only allow alphanumeric characters, dashes and underscores and should NOT allow spaces.

相关标签:
7条回答
  • 2020-12-23 11:38

    Got stupid error. So post here, if anyone find it useful

    1. [-\._] - means hyphen, dot and underscore
    2. [\.-_] - means all signs in range from dot to underscore
    0 讨论(0)
提交回复
热议问题