Perl/regex to remove first 3 lines and last 3 lines of a string
问题 I was looking to build a regex statement to always remove the first 3 lines of the string, and last 3 lines of the string (the middle part could be any n number of lines content). Any clean regex way to acheive this output? (i.e. always strip our first 3 lines and last 3 lines of the string - and preserve the middle part, which could be a variable # of lines) Thanks. e.g. Input String: " 1 2 3 <1...n # of lines content> 4 5 6 " To desired output string: "<1..n # of lines content>" 回答1: The