After I check if the ini file exists where it is expected to be, which I've learned how to do, I would like to check the file for proper formatting. I'd like to validate any number of "site" entries in the file and check that each entry adheres to the pattern below including the new line.
1| [site1] 2| shortcut=x1 3| site=example1.com 4| theme=alpha 5| 6| [site2] 7| shortcut=x2 8| site=example2.com 9| theme=beta 10|
I've got the individual values being validated as they are being read. I just want to make sure the pattern is correct before processing the file echoing the line number where the pattern breaks if it isn't.