กำลังมองหาความช่วยเหลือเกี่ยวกับ Perl ฉันไม่เก่งกับ regexes แต่โดยพื้นฐานแล้วฉันต้องการความช่วยเหลือดังนี้:
-strip out the leading blank line
-regex for any value after the directory `/foo/bar/set`, excluding trailing spaces
ผลลัพธ์ที่คาดหวัง:
55
proxy
test.event.done
ทดสอบไฟล์อินพุต:
<leading blank :line here>
/foo/bar/set/55
/foo/bar/set/proxy
/foo/bar/set/test.event.done
รหัส:
while(my $line=<>) {
chomp($line);
if ($line =~ m#foo/bar/set/(not sure what to match here) {
print "$line\n";
}
}
\S+
หรือไม่? - person tchrist   schedule 09.04.2011