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

前端 未结 7 662
忘掉有多难
忘掉有多难 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

提交回复
热议问题