eval.in

Paste #38486

Perl — Perl 5.16.1, pasted 8 months ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
use Data::Dumper;

    @sent = ("text <MIR-1> GGG-33 <EXP-V-3> text text <VACCVIRUS-PROP-1> some other.",
             " text <MIR-1> text <ASSC-PHRASE-1> text <VACCVIRUS-PROP-1> some other <PATTERN-1> other.");


    foreach $sent (@sent) {
       if ( $sent =~ /.*<MIR-\d+>.*<EXP-V-\d+>.*<VACCVIRUS-PROP-\d+>.*/gi ) {

          print "$sent\n";
        }
        elsif( $sent =~ /.*<MIR-\d+>.*<ASSC-PHRASE-\d+>.*<VACCVIRUS-PROP-\d+>/gi ) {
         print "$sent\n";
        }
    }

Program Output

text <MIR-1> GGG-33 <EXP-V-3> text text <VACCVIRUS-PROP-1> some other.
 text <MIR-1> text <ASSC-PHRASE-1> text <VACCVIRUS-PROP-1> some other <PATTERN-1> other.

OK (0.024 sec real, 0.027 sec wall, 11 MB, 343 syscalls)

Fork