Regex to *not* match any characters

前端 未结 10 1660
一个人的身影
一个人的身影 2020-12-24 11:18

I know it is quite some weird goal here but for a quick and dirty fix for one of our system we do need to not filter any input and let the corruption go into the system.

10条回答
  •  北荒
    北荒 (楼主)
    2020-12-24 11:40

    The ^ character doesn't mean "not" except inside a character class ([]). If you want to not match anything, you could use a negative lookahead that matches anything: (?!.*).

提交回复
热议问题