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