#!/usr/bin/perl -w use strict; my $string = qq{('AA','B','2','ProjectId','148')">Unique Information Here (Index)}; my $number = substr($string,27,3); #my $number = substr($string,27,index($string,"'",27) - 27); print "$number\n";