Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1079482]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2017-05-25 19:01 GMT
Find Nodes?
    Voting Booth?