From 2010c7efde8bc5c6869f24d08ce9479e600bc7b2 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 25 Mar 2023 15:37:46 +0300 Subject: [PATCH] new pattern, 0.1.2 --- source/readconf.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/readconf.d b/source/readconf.d index 42cdcf8..365c34a 100644 --- a/source/readconf.d +++ b/source/readconf.d @@ -13,6 +13,10 @@ private: string path; PP[string] properties; bool readed = false; + const string pattern = "^( |\\t)*(((\\w(\\w|-)+)(( |\\t)*(=>|=){1}" + ~ "( |\\t)*)(?!\\/(\\/|\\*))(([^ >\"'=\\n\\t#;].*?)|(\"(.+)\")" + ~ "|('(.+)')){1})|(\\[(\\w(\\w|-)+)\\])|(\\[()\\]))( |\\t)*" + ~ "(( |\\t)(#|;|\\/\\/|\\/\\*).*)?$"; /** * Parameter and its value with the ability to convert to the desired data type @@ -69,8 +73,6 @@ private: return; } - string pattern = "^ *(\\w+)(( +=> +)|( += +))(?!\\/\\/)(([^ >\"'\\n#;].*?)|" - ~ "(\"(.+?)\")|('(.+?)')){1} *( #.*?)?( ;.*?)?( \\/\\/.*)?$"; auto regular = regex(pattern, "m"); while (!configuration.eof())