This seems to be something very basic that I don't understand here.
/ a * / ?
> "abc" ~~ / a / ｢a｣ > "abc" ~~ / a * / ｢a｣ > "babc" ~~ / a * / ｢｣ # WHY? > "babc" ~~ / a + / ｢a｣
The answers here are correct, I'll just try to present them in a more coherent form:
Matching always starts from the left
The regex engine always starts at the left of the strings, and prefers left-most matches over longer matches
* matches empty strings
a* matches can match the strings
'aa' etc. It will always prefer the longest match it finds, but it can't find a match longer than the empty string, it'll just match the empty string.
Putting it together
'abc' ~~ /a*/, the regex engine starts at position 0, the
a* matches as many a's as it can, and thus matches the first character.
'babc' ~~ /a*/, the regex engine starts at position 0, and the
a* can match only zero characters. It does so successfully. Since the overall match succeeds, there is no reason to try again at position 1.