$text =~ / a* # zero or more of 'a' ( # followed by (ab)* # zero or more of 'ab' | # or b* # zero or more of 'b' )/x