in reply to Regexp and Inline::C

How would you code that with the perlapi

Possibly not what you're after, but I think *I* would actually do it as a callback:
use warnings; use Inline C => <<'EOC'; void C_foo(char *a) { dSP; ENTER; SAVETMPS; PUSHMARK(SP); POPMARK; PUSHMARK(SP); XPUSHs(sv_2mortal(newSVpv(a, 0))); PUTBACK; call_pv("foo", G_DISCARD); FREETMPS; LEAVE; } EOC my $string = "AAA:BBB"; C_foo($string); sub foo { $_[0] =~ /^([^:]+):([^:]+)$/; print "$1 - $2\n"; }
Cheers,
Rob