Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
没有空格且只允许使用数字、字母和破折号的字符串的正则表达式是什么?
提前致谢。
尝试使用这个:^(?! )[0-9a-zA-Z-]*$。我用于测试的示例可以在这里看到。
^(?! )[0-9a-zA-Z-]*$