I apologize if I haven't fully explained my scenario here 🙂
I am writing a GUI based DNS admin tool, removing a zone from the master list called named.conf (unix box) is the last bit I need to get through.
What someone does is the following:
They visit a page with a simple form, one line of text input (being the zone they wish to remove), once they submit the zone for removal, the code I'm trying to build will open up /etc/named.conf search for the zone and the surrounding text and remove just that zone and the text surroudning it. Its a bit comlpicated and like you Pig, regexes give me headaches which is why I'm running into a roadblock here. I'll definately check out the XML functions built in and see if I can somehow encapsulate the text and then remoev based on that.
Thanks.
EDIT: Here is the code I'm trying to work with at the moment and of course does not work.
$zone_del = <<< END
zone "$POST[domain]" {
type master;
notify yes;
file "$POST[domain]";
};
END;
$addtemp = file_get_contents("/etc/named.conf");
fopen("$addtemp", "r+");
str_replace("$addtemp", "","$zone_del");
fclose("$addtemp");