in reply to How do i get string between

your code,
this is a test /test123? $item1 =~ m/ \/(.*) \? /;
As per your regular expression ,searched pattern requires space before and after '?'.

But here searched pattern is not having space before and after '?'.
So use the regular expression,
$item1 =~/\/(.*)\?/;
$1 will have test123.