Need another good test case to understand this

what this means ’ * ’ Matches zero or more of the preceding element. , another example please

Let us say the previous element is ‘a’, that is it is something like

...a*...
then this means there can be as many a’s as you want.

1 Like

Also, if the previous element is ‘.’ then this means that there can be as many ‘.’ as you want, that is there can be any character as many times.

1 Like

so will abba / aa match with ab*a

Yes, both will match

what if * is in starting ?

regex with * in start is invalid, so there will be no such test case

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.