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

Re: Zonefile parsing

by zenmaster (Beadle)
on Dec 21, 2001 at 20:00 UTC ( [id://133785]=note: print w/replies, xml ) Need Help??


in reply to Zonefile parsing

Assumming that your file is read through STDIN this script :
while (<>) { print "$1\n" if /\s*(\w+)\s+NS\s+.*/ #print what found in parens if the (current) line # begins whith zero or more space/tab... one or # more letter (we save it by enclosing it in parens) # at least one space then the 2 letters NS followed # by at least a space anf maybe other char }
will do the job.

But BEWARE I've made (far too many) assumptions here....
  • NS is always uppercase (hint: see the i modifier otherwise)
  • The domain name is always followed by NS (it seems to be the case in your example...)
  • ...
Hope this helps in your regex learning...

You should may be edit your node and add some <BR> to make it more readable...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-23 22:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found