From 6032847c8d1a9cddaef5621ca54963df98ad6b76 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Mon, 24 Oct 2016 10:29:13 +0200 Subject: [PATCH] Doc: Using pattern substitution when expanding variables Change-Id: Ifaf8dddf7b5991d6b472d80cb9e94f42de75c1e7 Reviewed-by: Orgad Shaneh --- .../creator-projects-settings-build.qdoc | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/doc/src/projects/creator-projects-settings-build.qdoc b/doc/src/projects/creator-projects-settings-build.qdoc index ca38fa89d54..ad317c2b944 100644 --- a/doc/src/projects/creator-projects-settings-build.qdoc +++ b/doc/src/projects/creator-projects-settings-build.qdoc @@ -111,6 +111,30 @@ (\uicontrol {Variables}) button in a field to select from a list of variables that are available in a particular context. + \QC uses pattern substitution when expanding variable names. To replace the + first match of \e pattern within \e variable with \e replacement, use: + + \badcode + %{variable/pattern/replacement} + \endcode + + To replace all matches of \e pattern within \e variable with \e replacement, + use: + + \badcode + %{variable//pattern/replacement} + \endcode + + The pattern can be a regular expression and the replacement can contain + backreferences. For example, if \c %{variable} is \c my123var, then + \c %{variable/(..)(\d+)/\2\1} is expanded to \c {123myvar}. + + To use the default value if the variable is not set, use: + + \badcode + %{variable:-default} + \endcode + \section1 Build Steps The build system of \QC is built on qmake and make. In \uicontrol{Build Steps} you