Skip to content
Permalink
Browse files

Add missing ~ operator to expression builder

  • Loading branch information
nyalldawson committed Jan 19, 2017
1 parent f43dc8e commit 1f3c67f8e31835bda7551f7ea4a0f9598bc84926
Showing with 15 additions and 0 deletions.
  1. +14 −0 resources/function_help/json/op_regex
  2. +1 −0 src/gui/qgsexpressionbuilderwidget.cpp
@@ -0,0 +1,14 @@
{
"name": "~",
"type": "operator",
"description": "Performs a regular expression match on a string value.",
"arguments": [
{ "arg": "string", "description": "A string value" },
{ "arg": "regex", "description": "A regular expression. Slashes must be escaped, eg \\\\\\\\d." }
],
"examples": [
{ "expression":"'hello' ~ 'll'", "returns":"1"},
{ "expression":"'hello' ~ '^ll'", "returns":"0"},
{ "expression":"'hello' ~ 'llo$'", "returns":"1"}
]
}
@@ -453,6 +453,7 @@ void QgsExpressionBuilderWidget::updateFunctionTree()
registerItem( QStringLiteral( "Operators" ), QStringLiteral( "%" ), QStringLiteral( " % " ) );
registerItem( QStringLiteral( "Operators" ), QStringLiteral( "^" ), QStringLiteral( " ^ " ) );
registerItem( QStringLiteral( "Operators" ), QStringLiteral( "=" ), QStringLiteral( " = " ) );
registerItem( QStringLiteral( "Operators" ), QStringLiteral( "~" ), QStringLiteral( " ~ " ) );
registerItem( QStringLiteral( "Operators" ), QStringLiteral( ">" ), QStringLiteral( " > " ) );
registerItem( QStringLiteral( "Operators" ), QStringLiteral( "<" ), QStringLiteral( " < " ) );
registerItem( QStringLiteral( "Operators" ), QStringLiteral( "<>" ), QStringLiteral( " <> " ) );

0 comments on commit 1f3c67f

Please sign in to comment.
You can’t perform that action at this time.