Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: how to write multi-line regex

by BrowserUk (Pope)
on Mar 24, 2014 at 04:50 UTC ( #1079482=note: print w/ replies, xml ) Need Help??

in reply to how to write multi-line regex

Try this:

#! perl -slw use strict; $/ = ''; # Paragraph mode while (<DATA>) { if( /TEXT;\s+?LAYER 13[1-7];.+?STRING\s+(\S+)/s ) { print $1; } else{ print "not found!\n"; } } __DATA__ TEXT; LAYER 133; TEXTTYPE 0; PRESENTATION 0,2,0; STRANS 0,0,0; XY 1; X: 91410; Y: 50020; STRING AVDD12; ENDEL; BOUNDARY; LAYER 108; DATATYPE 0; XY 5; X: 0; Y: 0; X: 0; Y: 53530; X: 91410; Y: 53530; X: 91410; Y: 0; X: 0; Y: 0;


C:\test> AVDD12; not found!

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Comment on Re: how to write multi-line regex
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2015-11-25 22:40 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (692 votes), past polls