What strings does this regex matches ? (a|b)*

Joined
Dec 11, 2022
Messages
11
Reaction score
1
regepxal is showing infinite matches and shows "baaaaaaa" as a match. Doesn't (a|b) means a or b?
* means match 0 or more times. So, it should be matching aa,aaa,bb,bbb, , etc?
I'm not getting how baaaa is a match. Can anyone clarify please?
 
Joined
Dec 11, 2022
Messages
11
Reaction score
1
SOLVED. The perfect way to think about this for me is this:

(X)*= X X X X X X

Here X=a or b
So,

a or b then a or b then a or b then....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top