What’s the actual difference between `$(...)+` and `$(...)*`

This confused me for a long time.

(I'm assuming you're referring to the syntax in macro_rules! declarations)

$(...)* and $(...)+ pull from regex syntax. * means "any number of this expression, including 0," while + means "at least one and maybe more of this expression, but definitely not 0."

2 Likes