Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Matching '=' and other non alphanumeric characters using regular expressions

by blahblahblah (Priest)
on Dec 13, 2002 at 06:18 UTC ( [id://219510]=note: print w/replies, xml ) Need Help??


in reply to Matching '=' and other non alphanumeric characters using regular expressions

In addition to what the others have pointed out, I think you'll need to add an 's' to the end so that you can match across multiple lines, like this:
if ($string =~ /DEFINITION\s\s([\w\s]+)ACCESSION/s){ print "$1\n"; }
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:
$string =~ /DEFINITION\s\s(.*?)ACCESSION/s

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://219510]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-03-29 11:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found