Does the quantifier {0} make sense in some scenarios?

前端 未结 4 1602
无人共我
无人共我 2020-12-30 08:14

Example:

/(?:Foo){0}bar/

I saw something like this in another answer. At first I thought \"what should that be\", but then, \"OK could make sense, kind of a

4条回答
  •  一个人的身影
    2020-12-30 08:29

    An explicit repetition count of zero can be useful in automatically generated regular expressions. You avoid coding a special case for zero repetitions this way.

提交回复
热议问题