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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -