The following works for me:
use strict; use warnings; use feature 'say'; my $text = do{ local $/; <DATA> }; say $text =~ /Screening Ligands by X-ray crystallography/ ? 'MATCH!': +'NOPE'; __DATA__ --------- EFETCH RESULT(1..3): [ 1. Methods Mol Biol. 2014;1140:315-23. doi: 10.1007/978-1-4939-0354-2_ +23. Screening Ligands by X-ray crystallography. Davies DR(1). Author information: <edited for brevity>
Did you notice the lower case c?. However, you say that you "want to extract the PubMed IDs from the files." If that is the case then maybe you should just extract the number next to each occurrence of "PMID: " like so:
use strict; use warnings; use feature 'say'; my $text = do{ local $/; <DATA> }; my @pmids = $text =~ /PMID:\s+(\d+)/gm; say for @pmids; __DATA__ --------- EFETCH RESULT(1..3): [ Some title some author Author information: blah blah blah PMID: 24590727 --------- EFETCH RESULT(1..3): [ Some title some author Author information: blah blah blah PMID: 45867737 --------- EFETCH RESULT(1..3): [ Some title some author Author information: blah blah blah PMID: 52497072
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re^3: Regular Expression Hiccup
by jeffa
in thread Regular Expression Hiccup
by Mindsword
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |