RegExp matching string not starting with my

后端 未结 4 1046
余生分开走
余生分开走 2020-12-02 06:11

For PMD I\'d like to have a rule which warns me of those ugly variables which start with my.
This means I have to accept all variables which do NO

4条回答
  •  悲&欢浪女
    2020-12-02 06:56

    /^(?!my).*/
    

    (?!expression) is a negative lookahead; it matches a position where expression doesn't match starting at that position.

提交回复
热议问题