Difference between * and + regex

前端 未结 6 2019
你的背包
你的背包 2020-11-22 02:18

Can anybody tell me the difference between the * and + operators in the example below:

[<>]+ [<>]*

6条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 03:10

    * means zero or more of the previous expression.

    In other words, the expression is optional.

    You might define an integer like this:

    -*[0-9]+

    In other words, an optional negative sign followed by one or more digits.

提交回复
热议问题