Prevent Regex::new() from panicking when a non-AST item is repeated

This bug has also affected the regex! macro, which has caused an ICE
when such an invalid expression is provided.

Fixes #20208.
auto merge of #20238 : barosl/rust/regex-repeater-panic, r=huonw

This bug has also affected the `regex!` macro, which has caused an ICE when such an invalid expression is provided.

Fixes #20208.