> > One thing I've wondered about: is this thread safe? Is there a
chance
> > that between the first and second statements something will change
the
> > result of the global variables?
>
> They are thread-global variables. The same applies for $_.
>
> I still prefer this form for complex matches, though:
>
> if md = re.match(str) then
>    capture1, capture2 = md.captures
>    ...
> end

Nice, thanks.