[Solved] How to write a regular expression for javascript valiadation [closed]

[ad_1]

^[^ ]([\w- \.]+)[^ ]$

[^ ] = cannot start or end with space

([\w- .]+) = all characters allowed (or in this case, \w, hyphen, space and dot)

matches:
ABC BCD

1

[ad_2]

solved How to write a regular expression for javascript valiadation [closed]