in reply to Matching '=' and other non alphanumeric characters using regular expressions
Also, if you simply want to pick up everything between "DEFINITION " and "ACCESSION", another way to do it without worrying about knowing every possible character is like this:if ($string =~ /DEFINITION\s\s([\w\s]+)ACCESSION/s){ print "$1\n"; }
$string =~ /DEFINITION\s\s(.*?)ACCESSION/s
|
|---|