in reply to Regex question - capturing next char

Hello perluser4102, and welcome to the Monastery!

I would think the 'r' would fail a match at([^a-zA-Z]*) and the if block won't be entered.

The * quantifier specifies zero or more matches, so in this case it successfully matches zero times and the if condition is true. But if you terminate the regex with an end-of-line metacharacter $, the match fails:

if ($in_str =~ /^aa((<[^>]*>)*)([^a-zA-Z]*)$/) # ^

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,