Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How can I extract part of a string after a specific character

by DamnDirtyApe (Curate)
on Jul 11, 2002 at 05:13 UTC ( [id://180946] : note . print w/replies, xml ) Need Help??


in reply to How can I extract part of a string after a specific character

Here's two ways:

my $str = 'TITLE=SPECIAL CASE 1' ; # Using a regexp... $str =~ /^(.*?)=(.*?)$/ ; my $match = $2 ; print "Matched: [$match]\n" ; # Using split... my ( $before, $after ) = split '=', $str ; print "Matched: [$after]\n" ;

_______________
D a m n D i r t y A p e
Home Node | Email