Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^14: Bind zone file search

by ranceh (Initiate)
on Sep 27, 2012 at 16:30 UTC ( #996048=note: print w/replies, xml ) Need Help??


in reply to Re^13: Bind zone file search
in thread Bind zone file search

right, I need to avoid stanzas that begin with the // or #

Replies are listed 'Best First'.
Re^15: Bind zone file search
by Kenosis (Priest) on Sep 27, 2012 at 17:03 UTC

    Try the following modified regex in the subroutine:

    /(?<!#|\/)\s*zone\s+"([^"]+)".+?masters\s+{[\s#\/]*([a-zA-Z0-9.-]+)[\s +#\/;]*}/sg

    Added:

    (?<!#|\/)\s*zone ^ ^ ^ | | | | | + - 0+ whitespaces | + - Match "zone" and 0+ whitespaces that are not preceded by an " +#" or "/" + - Negative lookbehind

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996048]
help
Chatterbox?
[marto]: good morning all
[Discipulus]: good morning marto
[shmem]: good morning monkses and monksisses
[choroba]: Good morning!
[shmem]: GDPR meets butcher's shop

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2018-05-22 07:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?