Regular Expressions
Problem:
Have a forward DNS Zone file, need to create reverse zone file.
s/^([^ \t]*?)(\.binaryservice\.com\.)?[ \t]*(IN)?[ \t]+A[ \t]+([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/....in-addr.arpa. \tPTR \t.binaryservice.com./g;

Before:
mail                    IN A    172.24.1.25
ns.binaryservice.com.   IN A    172.24.1.26

# Spaces
photon                    IN A    172.24.1.27
bunyip                    IN   A    172.24.1.28

# Tabs instead of spaces
meeker          IN A    172.24.1.29
meeker          A       172.24.1.30 

# Tabs and spaces
yuan            IN       A       172.24.1.31
crank           IN      A   172.24.1.32

_________________________________________________________________
#### After ###
25.1.24.172.in-addr.arpa.       PTR     mail.binaryservice.com.
26.1.24.172.in-addr.arpa.       PTR     ns.binaryservice.com.
 
# Spaces
27.1.24.172.in-addr.arpa.       PTR     photon.binaryservice.com.
28.1.24.172.in-addr.arpa.       PTR     bunyip.binaryservice.com.
 
# Tabs instead of spaces
29.1.24.172.in-addr.arpa.       PTR     meeker.binaryservice.com.
30.1.24.172.in-addr.arpa.       PTR     meeker.binaryservice.com.
 
# Tabs and spaces
31.1.24.172.in-addr.arpa.       PTR     yuan.binaryservice.com.
32.1.24.172.in-addr.arpa.       PTR     crank.binaryservice.com.

Tux the Linux Penguin.