forked from qt-creator/qt-creator
Doc: Using pattern substitution when expanding variables
Change-Id: Ifaf8dddf7b5991d6b472d80cb9e94f42de75c1e7 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
ff2c49538b
commit
6032847c8d
@@ -111,6 +111,30 @@
|
|||||||
(\uicontrol {Variables}) button in a field to select from a list of variables that
|
(\uicontrol {Variables}) button in a field to select from a list of variables that
|
||||||
are available in a particular context.
|
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
|
\section1 Build Steps
|
||||||
|
|
||||||
The build system of \QC is built on qmake and make. In \uicontrol{Build Steps} you
|
The build system of \QC is built on qmake and make. In \uicontrol{Build Steps} you
|
||||||
|
Reference in New Issue
Block a user