diff src/constants.h @ 56:5410f9f279ea

Redefine question pattern to be more robust We now assume that a question begins after two empty lines.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 09 Aug 2016 09:59:16 +0200
parents aaaf8cdbc85c
children defd29b9f25a
line wrap: on
line diff
--- a/src/constants.h	Wed Jul 20 16:57:52 2016 +0200
+++ b/src/constants.h	Tue Aug 09 09:59:16 2016 +0200
@@ -55,7 +55,9 @@
  * A new question is the first unquoted string after the position
  * that is followed after a newline by the word "Answer"
  */
-#define QUESTION_PATTERN "([^\"]+)^(Answer.*$)", QRegularExpression::MultilineOption
+#define QUESTION_PATTERN "\n\n(.*)\n+(Answer.*$)", QRegularExpression::MultilineOption
+
+#define FIRST_QUESTION_PATTERN "(.*)\n+(Answer.*$)", QRegularExpression::MultilineOption
 
 /**
  * @brief Identifiying line that shows a question is a choice question. */
@@ -71,7 +73,7 @@
 
 /**
  * @brief The pattern used to match a free text answer. */
-#define FREETXT_PATTERN "\"([^\"]*)\"", QRegularExpression::MultilineOption
+#define FREETXT_PATTERN "\"([^\"]*)\"?", QRegularExpression::MultilineOption
 
 #define TITLE_ROW_HEIGHT 30
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)