0

I would like to parse Caddyfile block and only return hosts.

I am able to do it by reading the first line and search for { and then return hostname but when I have multiple hostname i am not sure how i can iterate through the text to find out other hostnames.

Is there a best practice to do this ?

https://caddyserver.com/docs/caddyfile/concepts

I have tried opening the file and using substring to find the point where I can extract the hostname but that only return first line.

ehsan310
  • 1
  • 2

0 Answers0