I'm wondering if it is better to re-organise the code a little bit to make easier to understand what is going on. Maybe I could split the search in few steps. It should be slightly slower but much more readable for future bug fixing or features implementation. For example I could first match a line if I know it will set a variable and catch the KEY, then grab everything after KEY=, the VALUE, and parse it in a second regex.
Issue #3 new