http://www.perlmonks.org?node_id=950867


in reply to multiple OR match fails

Would have been nice to include at least some piece of your input file. Your regex looks like it is missing some parentheses or something. Also, if your code is so short you might consider one-lining it:

~linux> perl -ne 'if(m/((FINDINGS|COMPLICATIONS):(.*?)([A-Z]+))/sgm){p +rint qq|$2$3\t$4\n|};' foo7.txt

Celebrate Intellectual Diversity

Replies are listed 'Best First'.
Re^2: multiple OR match fails
by ikegami (Patriarch) on Jan 31, 2012 at 06:16 UTC
    if (//g) should be while (//g).