# HG changeset patch
# User František Kučera <franta-hg@frantovo.cz>
# Date 1410039866 -7200
# Node ID f5b287fa69b6d60e3d2195a22b93b0d3f0197e1a
# Parent  0d8e8903d638858a631005fd020220440fed6131
in-ini: regex clean-up

diff -r 0d8e8903d638 -r f5b287fa69b6 java/alt2xml-in-ini/src/cz/frantovo/alt2xml/in/ini/Reader.java
--- a/java/alt2xml-in-ini/src/cz/frantovo/alt2xml/in/ini/Reader.java	Sat Sep 06 23:34:53 2014 +0200
+++ b/java/alt2xml-in-ini/src/cz/frantovo/alt2xml/in/ini/Reader.java	Sat Sep 06 23:44:26 2014 +0200
@@ -150,9 +150,9 @@
 
 				},
 		ENTRY(
-				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\]){0,1}\\s*=\\s*\"(?<value>[^']+)\"\\s*((;|#)\\s*(?<comment>.*)){0,1}", // quoted value → include spaces + might have comment
-				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\]){0,1}\\s*=\\s*'(?<value>[^']+)'\\s*((;|#)\\s*(?<comment>.*)){0,1}", // apostrophed value → include spaces + might have comment
-				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\]){0,1}\\s*=\\s*(?<value>.+)" // unquoted value → strip spaces + no comments
+				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\])?\\s*=\\s*\"(?<value>[^']+)\"\\s*((;|#)\\s*(?<comment>.*))?", // quoted value → include spaces + might have comment
+				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\])?\\s*=\\s*'(?<value>[^']+)'\\s*((;|#)\\s*(?<comment>.*))?", // apostrophed value → include spaces + might have comment
+				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\])?\\s*=\\s*(?<value>.+)" // unquoted value → strip spaces + no comments
 		) {
 					@Override
 					public void processLine(LineContext lc, FileContext fc) throws SAXException {