Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^15: Bind zone file search

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


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

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://996050]
help
Chatterbox?
and not a whimper to be heard...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2017-06-29 13:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (666 votes). Check out past polls.