Difference between * and + regex

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

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

[<>]+ [<>]*

6条回答
  •  遇见更好的自我
    2020-11-22 03:10

    They are quantifiers.

    • + means 1 or many (at least one occurrence for the match to succeed)
    • * means 0 or many (the match succeeds regardless of the presence of the search string)

提交回复
热议问题