Difference between * and + regex

regex

Solution

Each of them are quantifiers, the star quantifier(`*`) means that the preceding expression can match zero or more times it is like `{0,}` while the plus quantifier(`+`) indicate that the preceding expression MUST match at least one time or multiple times and it is the same as `{1,}` .

So to recap :

a*  ---> a{0,}  ---> Match a or aa or aaaaa or an empty string
a+  ---> a{1,}  ---> Match a or aa or aaaa but not a string empty

Problem

Can anybody tell me the difference between the `*` and `+` operators in the example below: `[<>]+` `[<>]*`

Original source

Related problems