What is the optimal way to read the above file content with the following condition:
The extracted value must be preceded by the pattern "# [a-z0-9]" - in other words, a hash character followed by space and then alpha-numeric characters.
The extracted value always starts with a new line.
What should you do if there are other lines which do not adhere to this convention?
How about your fourth line not meeting pattern requirement (space inside pattern is no allowed)
Optimal way is: read first two characters. If it is "# " then read rest of the line in name variable, check if it fits pattern. If everything is okay, read next line in value variable