Skip to content

Commit

Permalink
Add missing ~ operator to expression builder
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 19, 2017
1 parent f43dc8e commit 1f3c67f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions resources/function_help/json/op_regex
Original file line number Diff line number Diff line change
@@ -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"}
]
}
1 change: 1 addition & 0 deletions src/gui/qgsexpressionbuilderwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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( " <> " ) );
Expand Down

0 comments on commit 1f3c67f

Please sign in to comment.