What is a regex to match ONLY an empty string?

后端 未结 10 1679
忘掉有多难
忘掉有多难 2020-12-01 13:24

There are lots of posts about regexs to match a potentially empty string, but I couldn\'t readily find any which provided a regex which only matched an emp

10条回答
  •  旧时难觅i
    2020-12-01 14:22

    Wow, ya'll are overthinking it. It's as simple as the following. Besides, many of those answers aren't understood by the RE2 dialect used by C and golang.

    ^$
    

提交回复
热议问题