I have a directory of config files, each config file has a line like this:
DOMAIN domainname.com
I need to be able to extract everything after DOMAIN and store it in a json object.
I can match the line I need like this:
d = re.findall(^DOMAIN.*, mystring)
I can add that to a dict like this:
dict = {
"config": {
"domains": [
d,
]
}
}
This works but only for the first DOMAIN. How would I find all occurrences of DOMAIN and add it to the domains array?