in-ini: regex clean-up
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 06 Sep 2014 23:44:26 +0200
changeset 94f5b287fa69b6
parent 93 0d8e8903d638
child 95 c03497563ce3
in-ini: regex clean-up
java/alt2xml-in-ini/src/cz/frantovo/alt2xml/in/ini/Reader.java
     1.1 --- a/java/alt2xml-in-ini/src/cz/frantovo/alt2xml/in/ini/Reader.java	Sat Sep 06 23:34:53 2014 +0200
     1.2 +++ b/java/alt2xml-in-ini/src/cz/frantovo/alt2xml/in/ini/Reader.java	Sat Sep 06 23:44:26 2014 +0200
     1.3 @@ -150,9 +150,9 @@
     1.4  
     1.5  				},
     1.6  		ENTRY(
     1.7 -				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\]){0,1}\\s*=\\s*\"(?<value>[^']+)\"\\s*((;|#)\\s*(?<comment>.*)){0,1}", // quoted value → include spaces + might have comment
     1.8 -				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\]){0,1}\\s*=\\s*'(?<value>[^']+)'\\s*((;|#)\\s*(?<comment>.*)){0,1}", // apostrophed value → include spaces + might have comment
     1.9 -				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\]){0,1}\\s*=\\s*(?<value>.+)" // unquoted value → strip spaces + no comments
    1.10 +				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\])?\\s*=\\s*\"(?<value>[^']+)\"\\s*((;|#)\\s*(?<comment>.*))?", // quoted value → include spaces + might have comment
    1.11 +				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\])?\\s*=\\s*'(?<value>[^']+)'\\s*((;|#)\\s*(?<comment>.*))?", // apostrophed value → include spaces + might have comment
    1.12 +				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\])?\\s*=\\s*(?<value>.+)" // unquoted value → strip spaces + no comments
    1.13  		) {
    1.14  					@Override
    1.15  					public void processLine(LineContext lc, FileContext fc) throws SAXException {