trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lium...@apache.org
Subject [1/4] incubator-trafodion git commit: [TRAFODION-2403] update sql reference manual about REGEXP function
Date Fri, 23 Dec 2016 12:51:15 GMT
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master c69b501af -> ccd7c5581


[TRAFODION-2403] update sql reference manual about REGEXP function


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/49945da7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/49945da7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/49945da7

Branch: refs/heads/master
Commit: 49945da762ef47011b0e19a72b52ff18c27477d3
Parents: c5568f2
Author: Liu Ming <ovis_poly@sina.com>
Authored: Wed Dec 21 01:22:57 2016 +0000
Committer: Liu Ming <ovis_poly@sina.com>
Committed: Wed Dec 21 01:22:57 2016 +0000

----------------------------------------------------------------------
 .../_chapters/sql_language_elements.adoc        | 58 +++++++++++++++++++-
 1 file changed, 57 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/49945da7/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc
----------------------------------------------------------------------
diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc
index 535286f..2ce2a2a 100644
--- a/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc
+++ b/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc
@@ -2511,6 +2511,8 @@ subquery is empty, the predicate is false.
 | <<in_predicate,IN Predicate>> | Determines if a sequence of values is equal
to any of the sequences of
 values in a list of sequences.
 | <<like_predicate,LIKE Predicate>> | Searches for character strings that match
a pattern.
+| <<regexp_predicate,REGEXP Predicate>> | Searches for character strings that
match a pattern, The pattern 
+can be an extended regular expression.
 | <<null_predicate,NULL Predicate>> | Determines whether all the values in a
sequence of values are null.
 | <<quantified_comparison_predicates,Quantified Comparison Predicates>> +  
 (ALL, ANY, SOME ) | Compares the values of sequences of expressions to the values in each
@@ -3334,7 +3336,7 @@ trailing blank) will not be located by LIKE '%MB' but will be located
by
 LIKE '%MB%'.
 
 [[like_examples]]
-=== Examples
+==== Examples
 
 * Find all employee last names beginning with ZE:
 +
@@ -3352,6 +3354,60 @@ The escape character indicates that the underscore in 'FLOPPY_DISK'
is
 part of the string to search for, not a wild-card character.
 
 <<<
+[[regexp_predicate]]
+=== REGEXP Predicate
+
+Performs a pattern match of a string expression against a pattern . 
+The pattern can be an extended regular expression. 
+Returns 1 if expression matches pattern; otherwise it returns 0. 
+If either expression or pattern is NULL, the result is NULL.
+
+[[regexp_syntax]]
+==== Syntax
+```
+match-value [NOT] REGEXP pattern
+```
+
+* `_match-value_`
++
+is a character value expression that specifies a set of strings to
+search for that match the _pattern_.
+
+* `_pattern_`
++
+is a character value expression that specifies the pattern string for
+the search in form of Regular Expression.
+The Trafodion Regular Expression is following the POSIX regular expression rules.
+
+
+[[using_not]]
+===== Using NOT
+
+If you specify NOT, the predicate is true if the _pattern_ does not
+match any string in the _match-value_.
+
+[[regexp_examples]]
+==== Examples
+
+* Find valid numbers
++
+```
+col REGEXP '^[0-9]*\s*$'
+```
+
+* Find valid words, no numbers 
++
+```
+col REGEXP '^.[A-Za-z]+\s*$'
+```
+
+* Find valid email address
++
+```
+col REGEXP '\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*\s*'
+```
+
+<<<
 [[null_predicate]]
 === NULL Predicate
 


Mime
View raw message