I have a file that looks like this:
__FRANK LICHTENBERG, Columbia University _[4]Pharmaceutical Knowledge-Capital Accumulation and Longevity_ BARBARA FRAUMENI and SUMIYE OKUBO, Bureau of Economic Analysis _[5]R&D in the National Income and Product Accounts: A First Look at its impact on GDP_
and I want to grab out the titles. The titles begin with the 4 or 5 and end with a "_" char. In this example, I want to grab out
Pharmaceutical Knowledge-Capital Accumulation and Longevity
and
R&D in the National Income and Product Accounts: A First Look at its impact on GDP
This only matches the 1-liner number 4:
my (@tmp, @titles); while (<IN>) { if ( my @tmp = m/\_[\d\](.+)_/g ) { push @titles, @tmp; } }
How can I write a reg-exp to match across newlines in some but not all instances? I want to get both titles in to my @titles array.
thanks
In reply to how to reg-exp match across multiple lines? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |