Whar is the the meaning of "+" in the regex /ab+/?

Hi! I am Riyad. I can’t understand or remember Whar is the meaning of “+” in the regex /ab+/ ? Please help me with this one guys!!

It matches “one or more occurences” of the preceding symbol.

So your example would match “ab” or “abb” or “abbb” and so on.

I think the symbol * is responsible for matching “ab” or “abb” or “abbb” and so on. Isn’t it @colinthornton ?

That one matches zero or more occurences, so it would also match just “a”.

So, + symbol matches one or more occurrences but * matches zero or more occurrences. Isn’t it?

You got that right. I like to use this site to check my regex.


It has some good explanations on the cheatsheet.

tnx @colinthornton for your help.