Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^13: Bind zone file search

by Kenosis (Priest)
on Sep 27, 2012 at 15:59 UTC ( #996040=note: print w/ replies, xml ) Need Help??


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

By "commented," do you mean those containing either the "//" or "#" characters? Do you want to avoid all zone stanzas that contain those characters and use only those zone stanzas that don't contain those comment characters, i.e., "//" and "#"?


Comment on Re^13: Bind zone file search
Re^14: Bind zone file search
by ranceh (Initiate) on Sep 27, 2012 at 16:30 UTC

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

      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://996040]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (16)
As of 2014-12-19 17:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (90 votes), past polls