open(FILE, 'C:\Users\li\test11\164949.txt'); while () { if ( /(?<=##)(.*)(?=##)/g ) { print "$1\n"; } }