do { $foundstring =~ s§(\"]*)()~~([^~]+)~~()§$1$2$4§igs; } while $foundstring =~ m§(\"]*)()~~([^~]+)~~()§is;