$str= "Some text1 : Data Some Text2"; $str=~/:\s+Data\s(.+)\z/; $youwant=$1; ##$1 is the captured (.+) part print $youwant;