in reply to i wann get some character from a string
Is that ur home work ?
update ..
oruse strict; use warnings; my @strings = ( "http://mysite/bbsui.jsp?id=dxpwd", "http://mysite/bbsui.jsp?id=dxpsf", "http://mysite/bbsui.jsp?id=sfpwd", "http://mysite/bbsui.jsp?id=ds35e", "http://mysite/bbsui.jsp?id=124536" ); for ( @strings ) { my ($id) = split( /=/, $_)[1]; print "Id: $id\n"; }
$xyz = "http://mysite/bbsui.jsp?id=dxpwd"; $id = $1 if ($xyz =~ m/\?id=(.+?)$/i);
|
|---|