perl - Read a string of alphanumeric characters after a ; -
i'm teaching myself perl i'm pretty new language. i've been reading on , on regular expression can't figure out right context. want following:
let have file name "testfile" files contains 3 lines,
test first line test: first line test; third line
how can read , print out third 1 , after ;
without space. "this third line"
this i'm thinking $string =~ m/this third/
this edited incorrectly. in first , second sentence there should space before test.in third 1 shouldn't. want skip white space.
grabbing stdin, might this:
while ( <> ) { print $1 if /^test; (.*\n)/; }
Comments
Post a Comment