The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

REGEXP Functions

Convenience macro to get the REGEXP from a SV. This is approximately equivalent to the following snippet:

    if (SvMAGICAL(sv))
        mg_get(sv);
    if (SvROK(sv) &&
        (tmpsv = (SV*)SvRV(sv)) &&
        SvTYPE(tmpsv) == SVt_PVMG &&
        (tmpmg = mg_find(tmpsv, PERL_MAGIC_qr)))
    {
        return (REGEXP *)tmpmg->mg_obj;
    }

NULL will be returned if a REGEXP* is not found.

Returns a boolean indicating whether the SV contains qr magic (PERL_MAGIC_qr).

If you want to do something with the REGEXP* later use SvRX instead and check for NULL.