in reply to Extracting substrings from scalars

Here's a fragile "stab in the dark" approach to supposition one:

my $result; if( $aa =~ m/From:\s([^@]+)@/ ) { $result = $1; $result =~ s/\s</</g; }

And here's a fragile "stab in the dark" approach to supposition two:

my $result; if( $bb =~ m/UDP\s*([\d.]+);/ ) { $result = $1; }

These examples will handle the narrow examples you've provided, but are nowhere near fully complient SIP handlers. If you want a robust solution you'll need to give more information on what you're actually trying to do.


Dave