更新时间:2022-11-30 12:10:33
^[^.]*$
或
^[^.]+$
取决于您是否要匹配空字符串.某些应用程序可能会隐式提供 ^
和 $
,在这种情况下,它们是不必要的.例如:HTML5 input
元素的 pattern
属性.
Depending on whether you want to match empty string. Some applications may implicitly supply the ^
and $
, in which case they'd be unnecessary. For example: the HTML5 input
element's pattern
attribute.
您可以在 regular-expressions.info 站点上找到更多重要信息.
You can find a lot more great information on the regular-expressions.info site.