<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Regular expression functions</title>
    <link>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/</link>
    <description>Recent content in Regular expression functions on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Sql-Reference: MATCH_COLUMNS</title>
      <link>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/match-columns/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/match-columns/</guid>
      <description>
        
        
        &lt;p&gt;Specified as an element in a SELECT list, returns all columns in queried tables that match the specified pattern. For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT MATCH_COLUMNS (&amp;#39;%order%&amp;#39;) FROM store.store_orders_fact LIMIT 3;
 order_number | date_ordered | quantity_ordered | total_order_cost | reorder_level
--------------+--------------+------------------+------------------+---------------
       191119 | 2003-03-09   |               15 |             4021 |            23
        89985 | 2003-05-04   |               19 |             2692 |            23
       246962 | 2007-06-01   |               77 |             4419 |            42
(3 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;MATCH_COLUMNS (&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;pattern&lt;/span&gt;&amp;#39;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The pattern to match against all column names in the queried tables, where &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt; typically contains one or both of the following wildcard characters:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;_&lt;/code&gt; (underscore): Match any single character.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;%&lt;/code&gt; (percent sign): Match any string of zero or more characters.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The pattern can also include backslash (&lt;code&gt;\&lt;/code&gt;) characters to escape reserved characters that are embedded in column names: &lt;code&gt;_&lt;/code&gt;(underscore), &lt;code&gt;%&lt;/code&gt; (percent sign), and backlash (&lt;code&gt;\&lt;/code&gt;) itself.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;ddl-usage&#34;&gt;DDL usage&lt;/h2&gt;
&lt;p&gt;You can use MATCH_COLUMNS to define database objects—for example, specify it in &lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-projection/#&#34;&gt;CREATE PROJECTION&lt;/a&gt; to identify projection columns, or in &lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-table/&#34;&gt;CREATE TABLE...AS&lt;/a&gt; to identify columns in the new table. In all cases, OpenText™ Analytics Database expands the MATCH_COLUMNS output before it stores the object DDL. Subsequent changes to the original source table have no effect on the derived object definitions.&lt;/p&gt;
&lt;h2 id=&#34;restrictions&#34;&gt;Restrictions&lt;/h2&gt;
&lt;p&gt;In general, MATCH_COLUMNS is specified as an element in a SELECT list. For example, CREATE PROJECTION can call MATCH_COLUMNS to specify the columns to include in a projection. However, attempts to specify columns in the projection&#39;s segmentation clause return with an error:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE PROJECTION p_store_orders AS SELECT
    MATCH_COLUMNS(&amp;#39;%product%&amp;#39;),
    MATCH_COLUMNS(&amp;#39;%store%&amp;#39;),
    order_number FROM store.store_orders_fact SEGMENTED BY MATCH_COLUMNS(&amp;#39;products%&amp;#39;) ALL NODES;
ERROR 0:  MATCH_COLUMNS() function can only be specified as an element in a SELECT list
=&amp;gt; CREATE PROJECTION p_store_orders AS SELECT
    MATCH_COLUMNS(&amp;#39;%product%&amp;#39;),
    MATCH_COLUMNS(&amp;#39;%store%&amp;#39;),
    order_number FROM store.store_orders_fact;
WARNING 4468:  Projection &amp;lt;store.p_store_orders_b0&amp;gt; is not available for query processing. Execute the select start_refresh() function to copy data into this projection.
          The projection must have a sufficient number of buddy projections and all nodes must be up before starting a refresh
WARNING 4468:  Projection &amp;lt;store.p_store_orders_b1&amp;gt; is not available for query processing. Execute the select start_refresh() function to copy data into this projection.
          The projection must have a sufficient number of buddy projections and all nodes must be up before starting a refresh
CREATE PROJECTION
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you call MATCH_COLUMNS from a function that supports a fixed number of arguments, the database returns an error. For example, the &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/upper/#&#34;&gt;UPPER&lt;/a&gt; function supports only one argument; so calling MATCH_COLUMNS from UPPER as follows returns an error:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT MATCH_COLUMNS(&amp;#39;emp%&amp;#39;) FROM employee_dimension LIMIT 1;
-[ RECORD 1 ]-----------+---------------------------------
employee_key            | 1
employee_gender         | Male
employee_first_name     | Craig
employee_middle_initial | F
employee_last_name      | Robinson
employee_age            | 22
employee_street_address | 5 Bakers St
employee_city           | Thousand Oaks
employee_state          | CA
employee_region         | West

=&amp;gt; SELECT UPPER (MATCH_COLUMNS(&amp;#39;emp%&amp;#39;)) FROM employee_dimension;
ERROR 10465:  MATCH_COLUMNS() function can only be specified as an element in a SELECT list
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In contrast, the HASH function accepts an unlimited number of arguments, so calling MATCH_COLUMNS as an argument succeeds:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; select HASH(MATCH_COLUMNS(&amp;#39;emp%&amp;#39;)) FROM employee_dimension LIMIT 10;
        HASH
---------------------
 2047284364908178817
 1421997332260827278
 7981613309330877388
  792898558199431621
 5275639269069980417
 7892790768178152349
  184601038712735208
 3020263228621856381
 7056305566297085916
 3328422577712931057
(10 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;other-constraints&#34;&gt;Other constraints&lt;/h3&gt;
&lt;p&gt;The following usages of MATCH_COLUMNS are invalid and return with an error:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Including MATCH_COLUMNS in the non-recursive (base) term query of a &lt;a href=&#34;../../../../../en/sql-reference/statements/select/with-clause/with-clause-recursion/&#34;&gt;RECURSIVE WITH&lt;/a&gt; clause&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Concatenating the results of MATCH_COLUMNS calls:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT MATCH_COLUMNS (&amp;#39;%store%&amp;#39;)||MATCH_COLUMNS(&amp;#39;%store%&amp;#39;) FROM store.store_orders_fact;
ERROR 0:  MATCH_COLUMNS() function can only be specified as an element in a SELECT list
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Setting an alias on MATCH_COLUMNS&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following CREATE PROJECTION statement uses MATCH_COLUMNS to specify table columns in the new projection:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE PROJECTION p_store_orders AS SELECT
    MATCH_COLUMNS(&amp;#39;%product%&amp;#39;),
    MATCH_COLUMNS(&amp;#39;%store%&amp;#39;),
    order_number FROM store.store_orders_fact;
WARNING 4468:  Projection &amp;lt;store.p_store_orders_b0&amp;gt; is not available for query processing. Execute the select start_refresh() function to copy data into this projection.
          The projection must have a sufficient number of buddy projections and all nodes must be up before starting a refresh
WARNING 4468:  Projection &amp;lt;store.p_store_orders_b1&amp;gt; is not available for query processing. Execute the select start_refresh() function to copy data into this projection.
          The projection must have a sufficient number of buddy projections and all nodes must be up before starting a refresh
CREATE PROJECTION

=&amp;gt; SELECT export_objects(&amp;#39;&amp;#39;, &amp;#39;store.p_store_orders_b0&amp;#39;);
...

CREATE PROJECTION store.p_store_orders_b0 /*+basename(p_store_orders)*/
(
 product_key,
 product_version,
 store_key,
 order_number
)
AS
 SELECT store_orders_fact.product_key,
        store_orders_fact.product_version,
        store_orders_fact.store_key,
        store_orders_fact.order_number
 FROM store.store_orders_fact
 ORDER BY store_orders_fact.product_key,
          store_orders_fact.product_version,
          store_orders_fact.store_key,
          store_orders_fact.order_number
SEGMENTED BY hash(store_orders_fact.product_key, store_orders_fact.product_version, store_orders_fact.store_key, store_orders_fact.order_number) ALL NODES OFFSET 0;

SELECT MARK_DESIGN_KSAFE(1);

(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As shown in the EXPORT_OBJECTS output, the database stores the result sets of the two MATCH_COLUMNS calls in the new projection&#39;s DDL. Later changes in the anchor table DDL have no effect on this projection.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: REGEXP_COUNT</title>
      <link>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-count/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-count/</guid>
      <description>
        
        
        &lt;p&gt;Returns the number times a regular expression matches a string.&lt;/p&gt;
&lt;p&gt;This function operates on UTF-8 strings using the default locale, even if the locale is set otherwise.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
If you port a regular expression query from an Oracle database, remember that Oracle considers a zero-length string to be equivalent to NULL, while OpenText™ Analytics Database does not.
&lt;/div&gt;&lt;/p&gt;

&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;REGEXP_COUNT ( &lt;span class=&#34;code-variable&#34;&gt;string-expession&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;pattern&lt;/span&gt; [, &lt;span class=&#34;code-variable&#34;&gt;position&lt;/span&gt; [, &lt;span class=&#34;code-variable&#34;&gt;regexp-modifier &lt;/span&gt;]... ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The &lt;code&gt;VARCHAR&lt;/code&gt; or &lt;code&gt;LONG VARCHAR&lt;/code&gt; expression to evaluate for matches with the regular expression specified in &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;. If &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt; is in the &lt;code&gt;__raw__&lt;/code&gt; column of a flex or columnar table, cast the string to a &lt;code&gt;LONG VARCHAR&lt;/code&gt; before searching for &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The regular expression to match against &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;. The regular expression must conform with &lt;a href=&#34;http://perldoc.perl.org/perlre.html&#34;&gt;Perl regular expression syntax&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;position&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The number of characters from the start of the string where the function should start searching for matches. By default, the function begins searching for a match at the first (leftmost) character. Setting this parameter to a value greater than 1 begins searching for a match at the *&lt;code&gt;n&lt;/code&gt;*th character you specify.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 1&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;regexp-modifier&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;One or more single-character flags that modify how the regular expression &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt; is matched to &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;b&lt;/code&gt;: 				Treat strings as binary octets, rather than UTF-8 characters.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;c&lt;/code&gt; (default): 				Force the match to be case sensitive.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;i&lt;/code&gt;: 				Force the match to be case insensitive.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;m&lt;/code&gt;: 				Treat the string to match as multiple lines. Using this modifier, the start of line (&lt;code&gt;^&lt;/code&gt;) and end of line (&lt;code&gt;$)&lt;/code&gt; regular expression operators match line breaks (&lt;code&gt;\n&lt;/code&gt;) within the string. Without the &lt;code&gt;m&lt;/code&gt; modifier, the start and end of line operators match only the start and end of the string.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;n&lt;/code&gt;: 				Match the regular expression operator (&lt;code&gt;.&lt;/code&gt;) to a newline (&lt;code&gt;\n&lt;/code&gt;). By default, the &lt;code&gt;.&lt;/code&gt; operator matches any character except a newline.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;x&lt;/code&gt;: 				Add comments to regular expressions. The &lt;code&gt;x&lt;/code&gt; modifier causes the function to ignore all un-escaped space characters and comments in the regular expression. Comments start with hash (&lt;code&gt;#&lt;/code&gt;) and end with a newline (&lt;code&gt;\n&lt;/code&gt;). All spaces in the regular expression to be matched in strings must be escaped with a backslash (&lt;code&gt;\&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Count the number of occurrences of the substring &lt;code&gt;an&lt;/code&gt; in the specified string (&lt;code&gt;a man, a plan, a canal: Panama&lt;/code&gt;):&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_COUNT(&amp;#39;a man, a plan, a canal: Panama&amp;#39;, &amp;#39;an&amp;#39;);
 REGEXP_COUNT
--------------
            4
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Find the number of occurrences of the substring &lt;code&gt;an&lt;/code&gt;, starting with the fifth character.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_COUNT(&amp;#39;a man, a plan, a canal: Panama&amp;#39;, &amp;#39;an&amp;#39;,5);
 REGEXP_COUNT
--------------
            3
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Find the number of occurrences of a substring containing a lower-case character followed by &lt;code&gt;an&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_COUNT(&amp;#39;a man, a plan, a canal: Panama&amp;#39;, &amp;#39;[a-z]an&amp;#39;);
 REGEXP_COUNT
--------------
            3
(1 row
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;REGEXP_COUNT specifies the &lt;code&gt;i&lt;/code&gt; modifier, so it ignores case:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT REGEXP_COUNT(&amp;#39;a man, a plan, a canal: Panama&amp;#39;, &amp;#39;[a-z]an&amp;#39;, 1, &amp;#39;i&amp;#39;);

 REGEXP_COUNT
--------------
            4
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: REGEXP_ILIKE</title>
      <link>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-ilike/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-ilike/</guid>
      <description>
        
        
        &lt;p&gt;Returns true if the string contains a match for the regular expression. REGEXP_ILIKE is similar to the &lt;a href=&#34;../../../../../en/sql-reference/language-elements/predicates/like/#&#34;&gt;LIKE&lt;/a&gt;, except that it uses a case insensitive regular expression, rather than simple wildcard character matching.&lt;/p&gt;
&lt;p&gt;This function operates on UTF-8 strings using the default locale, even if the locale is set otherwise.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
If you port a regular expression query from an Oracle database, remember that Oracle considers a zero-length string to be equivalent to NULL, while OpenText™ Analytics Database does not.
&lt;/div&gt;&lt;/p&gt;

&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;REGEXP_ILIKE ( &lt;span class=&#34;code-variable&#34;&gt;string-expression&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;pattern&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;``&lt;/dt&gt;
&lt;dd&gt;The &lt;code&gt;VARCHAR&lt;/code&gt; or &lt;code&gt;LONG VARCHAR&lt;/code&gt; expression to evaluate for matches with the regular expression specified in &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;. If &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt; is in the &lt;code&gt;__raw__&lt;/code&gt; column of a flex or columnar table, cast the string to a &lt;code&gt;LONG VARCHAR&lt;/code&gt; before searching for &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;``&lt;/dt&gt;
&lt;dd&gt;The regular expression to match against &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;. The regular expression must conform with &lt;a href=&#34;http://perldoc.perl.org/perlre.html&#34;&gt;Perl regular expression syntax&lt;/a&gt;.&lt;/dd&gt;
&lt;/dl&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;This example creates a table containing several strings to demonstrate regular expressions.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create table &lt;code&gt;longvc&lt;/code&gt; with a single, long varchar column &lt;code&gt;body&lt;/code&gt;, and insert data with distinct characters:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE table longvc(body long varchar (1048576));
CREATE TABLE

=&amp;gt; insert into longvc values (&amp;#39;На берегу пустынных волн&amp;#39;);
=&amp;gt; insert into longvc values (&amp;#39;Voin syödä lasia, se ei vahingoita minua&amp;#39;);
=&amp;gt; insert into longvc values (&amp;#39;私はガラスを食べられます。それは私を傷つけません。&amp;#39;);
=&amp;gt; insert into longvc values (&amp;#39;Je peux manger du verre, ça ne me fait pas mal.&amp;#39;);
=&amp;gt; insert into longvc values (&amp;#39;zésbaésbaa&amp;#39;);
=&amp;gt; insert into longvc values (&amp;#39;Out of the frying pan, he landed immediately in the fire&amp;#39;);

=&amp;gt; SELECT * FROM longvc;
                      body
------------------------------------------------
 На берегу пустынных волн
 Voin syödä lasia, se ei vahingoita minua
 私はガラスを食べられます。それは私を傷つけません。
 Je peux manger du verre, ça ne me fait pas mal.
 zésbaésbaa
 Out of the frying pan, he landed immediately in the fire
(6 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pattern match table rows containing the character &lt;code&gt;ç&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM longvc where regexp_ilike(body, &amp;#39;ç&amp;#39;);
                      body
-------------------------------------------------
 Je peux manger du verre, ça ne me fait pas mal.
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select all rows that contain the characters &lt;code&gt;A&lt;/code&gt;/&lt;code&gt;a&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM longvc where regexp_ilike(body, &amp;#39;A&amp;#39;);
                      body
-------------------------------------------------
 Je peux manger du verre, ça ne me fait pas mal.
 Voin syödä lasia, se ei vahingoita minua
 zésbaésbaa
(3 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select all rows that contain the characters &lt;code&gt;O&lt;/code&gt;/&lt;code&gt;o&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM longvc where regexp_ilike(body, &amp;#39;O&amp;#39;);
                           body
----------------------------------------------------------
 Voin syödä lasia, se ei vahingoita minua
 Out of the frying pan, he landed immediately in the fire
(2 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: REGEXP_INSTR</title>
      <link>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-instr/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-instr/</guid>
      <description>
        
        
        &lt;p&gt;Returns the starting or ending position in a string where a regular expression matches. REGEXP_INSTR returns 0 if no match for the regular expression is found in the string.&lt;/p&gt;
&lt;p&gt;This function operates on UTF-8 strings using the default locale, even if the locale is set otherwise.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
If you port a regular expression query from an Oracle database, remember that Oracle considers a zero-length string to be equivalent to NULL, while OpenText™ Analytics Database does not.
&lt;/div&gt;&lt;/p&gt;

&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;REGEXP_INSTR ( &lt;span class=&#34;code-variable&#34;&gt;string-expression&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;pattern &lt;/span&gt;
   [, &lt;span class=&#34;code-variable&#34;&gt;position&lt;/span&gt; [, &lt;span class=&#34;code-variable&#34;&gt;occurrence&lt;/span&gt; [, &lt;span class=&#34;code-variable&#34;&gt;return-position&lt;/span&gt; [, &lt;span class=&#34;code-variable&#34;&gt;regexp-modifier &lt;/span&gt;]... [, &lt;span class=&#34;code-variable&#34;&gt;captured-subexp&lt;/span&gt; ]]]] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The &lt;code&gt;VARCHAR&lt;/code&gt; or &lt;code&gt;LONG VARCHAR&lt;/code&gt; expression to evaluate for matches with the regular expression specified in &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;. If &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt; is in the &lt;code&gt;__raw__&lt;/code&gt; column of a flex or columnar table, cast the string to a &lt;code&gt;LONG VARCHAR&lt;/code&gt; before searching for &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The regular expression to match against &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;. The regular expression must conform with &lt;a href=&#34;http://perldoc.perl.org/perlre.html&#34;&gt;Perl regular expression syntax&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;position&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The number of characters from the start of the string where the function should start searching for matches. By default, the function begins searching for a match at the first (leftmost) character. Setting this parameter to a value greater than 1 begins searching for a match at the *&lt;code&gt;n&lt;/code&gt;*th character you specify.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 1&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;occurrence&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Controls which occurrence of a pattern match in the string to return. By default, the function returns the position of the first matching substring. Use this parameter to find the position of subsequent matching substrings. For example, setting this parameter to 3 returns the position of the third substring that matches the pattern.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 1&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;return-position&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Sets the position within the string to return. Using the default position (0), the function returns the string position of the first character of the substring that matches the pattern. If you set &lt;em&gt;&lt;code&gt;return-position&lt;/code&gt;&lt;/em&gt; to 1, the function returns the position of the first character after the end of the matching substring.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 0&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;regexp-modifier&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;One or more single-character flags that modify how the regular expression &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt; is matched to &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;b&lt;/code&gt;: 				Treat strings as binary octets, rather than UTF-8 characters.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;c&lt;/code&gt; (default): 				Force the match to be case sensitive.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;i&lt;/code&gt;: 				Force the match to be case insensitive.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;m&lt;/code&gt;: 				Treat the string to match as multiple lines. Using this modifier, the start of line (&lt;code&gt;^&lt;/code&gt;) and end of line (&lt;code&gt;$)&lt;/code&gt; regular expression operators match line breaks (&lt;code&gt;\n&lt;/code&gt;) within the string. Without the &lt;code&gt;m&lt;/code&gt; modifier, the start and end of line operators match only the start and end of the string.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;n&lt;/code&gt;: 				Match the regular expression operator (&lt;code&gt;.&lt;/code&gt;) to a newline (&lt;code&gt;\n&lt;/code&gt;). By default, the &lt;code&gt;.&lt;/code&gt; operator matches any character except a newline.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;x&lt;/code&gt;: 				Add comments to regular expressions. The &lt;code&gt;x&lt;/code&gt; modifier causes the function to ignore all un-escaped space characters and comments in the regular expression. Comments start with hash (&lt;code&gt;#&lt;/code&gt;) and end with a newline (&lt;code&gt;\n&lt;/code&gt;). All spaces in the regular expression to be matched in strings must be escaped with a backslash (&lt;code&gt;\&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;captured-subexp&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The captured subexpression whose position to return. By default, the function returns the position of the first character in &lt;em&gt;&lt;code&gt;string&lt;/code&gt;&lt;/em&gt; that matches the regular expression. If you set this value from 1 – 9, the function returns the subexpression captured by the corresponding set of parentheses in the regular expression. For example, setting this value to 3 returns the substring captured by the third set of parentheses in the regular expression.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 0&lt;/p&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

The subexpressions are numbered left to right, based on the appearance of opening parenthesis, so nested regular expressions . For example, in the regular expression &lt;code&gt;\s*(\w+\s+(\w+))&lt;/code&gt;, subexpression 1 is the one that captures everything but any leading whitespaces.

&lt;/div&gt;

&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Find the first occurrence of a sequence of letters starting with the letter &lt;code&gt;e&lt;/code&gt; and ending with the letter &lt;code&gt;y&lt;/code&gt; in the specified string (&lt;code&gt;easy come, easy go&lt;/code&gt;).&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_INSTR(&amp;#39;easy come, easy go&amp;#39;,&amp;#39;e\w*y&amp;#39;);
 REGEXP_INSTR
--------------
            1
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Starting at the second character (&lt;code&gt;2&lt;/code&gt;), find the first sequence of letters starting with the letter &lt;code&gt;e&lt;/code&gt; and ending with the letter &lt;code&gt;y&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_INSTR(&amp;#39;easy come, easy go&amp;#39;,&amp;#39;e\w*y&amp;#39;,2);
 REGEXP_INSTR
--------------
           12
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Starting at the first character (&lt;code&gt;1&lt;/code&gt;), find the second sequence of letters starting with the letter &lt;code&gt;e&lt;/code&gt; and ending with the letter &lt;code&gt;y&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_INSTR(&amp;#39;easy come, easy go&amp;#39;,&amp;#39;e\w*y&amp;#39;,1,2);
 REGEXP_INSTR
--------------
           12
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Find the position of the first character after the first whitespace:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_INSTR(&amp;#39;easy come, easy go&amp;#39;,&amp;#39;\s&amp;#39;,1,1,1);
 REGEXP_INSTR
--------------
            6
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Find the position of the start of the third word in a string by capturing each word as a subexpression, and returning the third subexpression&#39;s start position.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_INSTR(&amp;#39;one two three&amp;#39;,&amp;#39;(\w+)\s+(\w+)\s+(\w+)&amp;#39;, 1,1,0,&amp;#39;&amp;#39;,3);
REGEXP_INSTR
--------------
            9
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: REGEXP_LIKE</title>
      <link>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-like/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-like/</guid>
      <description>
        
        
        &lt;p&gt;Returns true if the string matches the regular expression. REGEXP_LIKE is similar to the &lt;a href=&#34;../../../../../en/sql-reference/language-elements/predicates/like/#&#34;&gt;LIKE&lt;/a&gt;, except that it uses regular expressions rather than simple wildcard character matching.&lt;/p&gt;
&lt;p&gt;This function operates on UTF-8 strings using the default locale, even if the locale is set otherwise.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
If you port a regular expression query from an Oracle database, remember that Oracle considers a zero-length string to be equivalent to NULL, while OpenText™ Analytics Database does not.
&lt;/div&gt;&lt;/p&gt;

&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;REGEXP_LIKE ( &lt;span class=&#34;code-variable&#34;&gt;string-expression&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;pattern &lt;/span&gt;[, &lt;span class=&#34;code-variable&#34;&gt;regexp-modifier&lt;/span&gt; ]... )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The &lt;code&gt;VARCHAR&lt;/code&gt; or &lt;code&gt;LONG VARCHAR&lt;/code&gt; expression to evaluate for matches with the regular expression specified in &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;. If &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt; is in the &lt;code&gt;__raw__&lt;/code&gt; column of a flex or columnar table, cast the string to a &lt;code&gt;LONG VARCHAR&lt;/code&gt; before searching for &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The regular expression to match against &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;. The regular expression must conform with &lt;a href=&#34;http://perldoc.perl.org/perlre.html&#34;&gt;Perl regular expression syntax&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;regexp-modifier&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;One or more single-character flags that modify how the regular expression &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt; is matched to &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;b&lt;/code&gt;: 				Treat strings as binary octets, rather than UTF-8 characters.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;c&lt;/code&gt; (default): 				Force the match to be case sensitive.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;i&lt;/code&gt;: 				Force the match to be case insensitive.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;m&lt;/code&gt;: 				Treat the string to match as multiple lines. Using this modifier, the start of line (&lt;code&gt;^&lt;/code&gt;) and end of line (&lt;code&gt;$)&lt;/code&gt; regular expression operators match line breaks (&lt;code&gt;\n&lt;/code&gt;) within the string. Without the &lt;code&gt;m&lt;/code&gt; modifier, the start and end of line operators match only the start and end of the string.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;n&lt;/code&gt;: 				Match the regular expression operator (&lt;code&gt;.&lt;/code&gt;) to a newline (&lt;code&gt;\n&lt;/code&gt;). By default, the &lt;code&gt;.&lt;/code&gt; operator matches any character except a newline.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;x&lt;/code&gt;: 				Add comments to regular expressions. The &lt;code&gt;x&lt;/code&gt; modifier causes the function to ignore all un-escaped space characters and comments in the regular expression. Comments start with hash (&lt;code&gt;#&lt;/code&gt;) and end with a newline (&lt;code&gt;\n&lt;/code&gt;). All spaces in the regular expression to be matched in strings must be escaped with a backslash (&lt;code&gt;\&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Create a table that contains several strings:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE t (v VARCHAR);
CREATE TABLE
=&amp;gt; CREATE PROJECTION t1 AS SELECT * FROM t;
CREATE PROJECTION
=&amp;gt; COPY t FROM stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
&amp;gt;&amp;gt; aaa
&amp;gt;&amp;gt; Aaa
&amp;gt;&amp;gt; abc
&amp;gt;&amp;gt; abc1
&amp;gt;&amp;gt; 123
&amp;gt;&amp;gt; \.
=&amp;gt; SELECT * FROM t;
   v
-------
 aaa
 Aaa
 abc
 abc1
 123
(5 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Select all records from table &lt;code&gt;t&lt;/code&gt; that contain the letter &lt;code&gt;a&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT v FROM t WHERE REGEXP_LIKE(v,&amp;#39;a&amp;#39;);
  v
------
 Aaa
 aaa
 abc
 abc1
(4 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Select all rows from table &lt;code&gt;t&lt;/code&gt; that start with the letter &lt;code&gt;a&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT v FROM t WHERE REGEXP_LIKE(v,&amp;#39;^a&amp;#39;);
  v
------
 aaa
 abc
 abc1
(3 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Select all rows that contain the substring &lt;code&gt;aa&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT v FROM t WHERE REGEXP_LIKE(v,&amp;#39;aa&amp;#39;);
  v
-----
 Aaa
 aaa
(2 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Select all rows that contain a digit.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT v FROM t WHERE REGEXP_LIKE(v,&amp;#39;\d&amp;#39;);
  v
------
 123
 abc1
(2 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Select all rows that contain the substring &lt;code&gt;aaa&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT v FROM t WHERE REGEXP_LIKE(v,&amp;#39;aaa&amp;#39;);
  v
-----
 aaa
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Select all rows that contain the substring &lt;code&gt;aaa&lt;/code&gt; using case-insensitive matching.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT v FROM t WHERE REGEXP_LIKE(v,&amp;#39;aaa&amp;#39;, &amp;#39;i&amp;#39;);
  v
-----
 Aaa
 aaa
(2 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Select rows that contain the substring &lt;code&gt;a b c&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT v FROM t WHERE REGEXP_LIKE(v,&amp;#39;a b c&amp;#39;);
 v
---
(0 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Select rows that contain the substring &lt;code&gt;a b c&lt;/code&gt;, ignoring space within the regular expression.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT v FROM t WHERE REGEXP_LIKE(v,&amp;#39;a b c&amp;#39;,&amp;#39;x&amp;#39;);
  v
------
 abc
 abc1
(2 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Add multi-line rows to table &lt;code&gt;t&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; COPY t FROM stdin RECORD TERMINATOR &amp;#39;!&amp;#39;;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
&amp;gt;&amp;gt; Record 1 line 1
&amp;gt;&amp;gt; Record 1 line 2
&amp;gt;&amp;gt; Record 1 line 3!
&amp;gt;&amp;gt; Record 2 line 1
&amp;gt;&amp;gt; Record 2 line 2
&amp;gt;&amp;gt; Record 2 line 3!
&amp;gt;&amp;gt; \.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Select rows from table &lt;code&gt;t&lt;/code&gt; that start with the substring &lt;code&gt;Record&lt;/code&gt; and end with the substring &lt;code&gt;line 2&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT v from t WHERE REGEXP_LIKE(v,&amp;#39;^Record.*line 2$&amp;#39;);
 v
---
(0 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Select rows that start with the substring &lt;code&gt;Record&lt;/code&gt; and end with the substring &lt;code&gt;line 2&lt;/code&gt;, treating multiple lines as separate strings.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT v from t WHERE REGEXP_LIKE(v,&amp;#39;^Record.*line 2$&amp;#39;,&amp;#39;m&amp;#39;);
                        v
--------------------------------------------------

Record 2 line 1
Record 2 line 2
Record 2 line 3
Record 1 line 1
Record 1 line 2
Record 1 line 3
(2 rows)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: REGEXP_NOT_ILIKE</title>
      <link>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-not-ilike/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-not-ilike/</guid>
      <description>
        
        
        &lt;p&gt;Returns true if the string does not match the case-insensitive regular expression.
&lt;p&gt;This function operates on UTF-8 strings using the default locale, even if the locale is set otherwise.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
If you port a regular expression query from an Oracle database, remember that Oracle considers a zero-length string to be equivalent to NULL, while OpenText™ Analytics Database does not.
&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;REGEXP_NOT_ILIKE ( &lt;span class=&#34;code-variable&#34;&gt;string-expression&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;pattern&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;``&lt;/dt&gt;
&lt;dd&gt;The &lt;code&gt;VARCHAR&lt;/code&gt; or &lt;code&gt;LONG VARCHAR&lt;/code&gt; expression to evaluate for matches with the regular expression specified in &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;. If &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt; is in the &lt;code&gt;__raw__&lt;/code&gt; column of a flex or columnar table, cast the string to a &lt;code&gt;LONG VARCHAR&lt;/code&gt; before searching for &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;``&lt;/dt&gt;
&lt;dd&gt;The regular expression to match against &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;. The regular expression must conform with &lt;a href=&#34;http://perldoc.perl.org/perlre.html&#34;&gt;Perl regular expression syntax&lt;/a&gt;.&lt;/dd&gt;
&lt;/dl&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a table (&lt;code&gt;longvc&lt;/code&gt;) with a single, long varchar column (&lt;code&gt;body&lt;/code&gt;). Then, insert data with some distinct characters, and query the table contents:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE table longvc(body long varchar (1048576));
CREATE TABLE

=&amp;gt; insert into longvc values (&amp;#39;На берегу пустынных волн&amp;#39;);
=&amp;gt; insert into longvc values (&amp;#39;Voin syödä lasia, se ei vahingoita minua&amp;#39;);
=&amp;gt; insert into longvc values (&amp;#39;私はガラスを食べられます。それは私を傷つけません。&amp;#39;);
=&amp;gt; insert into longvc values (&amp;#39;Je peux manger du verre, ça ne me fait pas mal.&amp;#39;);
=&amp;gt; insert into longvc values (&amp;#39;zésbaésbaa&amp;#39;);

=&amp;gt; SELECT * FROM longvc;
                      body
------------------------------------------------
 На берегу пустынных волн
 Voin syödä lasia, se ei vahingoita minua
 私はガラスを食べられます。それは私を傷つけません。
 Je peux manger du verre, ça ne me fait pas mal.
 zésbaésbaa
(5 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Find all rows that do not contain the character &lt;code&gt;ç&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT * FROM longvc where regexp_not_ilike(body, &amp;#39;ç&amp;#39;);
                        body
----------------------------------------------------
 Voin syödä lasia, se ei vahingoita minua
 zésbaésbaa
 На берегу пустынных волн
 私はガラスを食べられます。それは私を傷つけません。
(4 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Find all rows that do not contain the substring &lt;code&gt;a&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM longvc where regexp_not_ilike(body, &amp;#39;a&amp;#39;);
                        body
----------------------------------------------------
 На берегу пустынных волн
 私はガラスを食べられます。それは私を傷つけません。
(2 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: REGEXP_NOT_LIKE</title>
      <link>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-not-like/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-not-like/</guid>
      <description>
        
        
        &lt;p&gt;Returns true if the string does not contain a match for the regular expression. REGEXP_NOT_LIKE is a case sensitive regular expression.&lt;/p&gt;
&lt;p&gt;This function operates on UTF-8 strings using the default locale, even if the locale is set otherwise.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
If you port a regular expression query from an Oracle database, remember that Oracle considers a zero-length string to be equivalent to NULL, while OpenText™ Analytics Database does not.
&lt;/div&gt;&lt;/p&gt;

&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;REGEXP_NOT_LIKE ( &lt;span class=&#34;code-variable&#34;&gt;string-expression&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;pattern&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;``&lt;/dt&gt;
&lt;dd&gt;The &lt;code&gt;VARCHAR&lt;/code&gt; or &lt;code&gt;LONG VARCHAR&lt;/code&gt; expression to evaluate for matches with the regular expression specified in &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;. If &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt; is in the &lt;code&gt;__raw__&lt;/code&gt; column of a flex or columnar table, cast the string to a &lt;code&gt;LONG VARCHAR&lt;/code&gt; before searching for &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;``&lt;/dt&gt;
&lt;dd&gt;The regular expression to match against &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;. The regular expression must conform with &lt;a href=&#34;http://perldoc.perl.org/perlre.html&#34;&gt;Perl regular expression syntax&lt;/a&gt;.&lt;/dd&gt;
&lt;/dl&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a table (&lt;code&gt;longvc&lt;/code&gt;) with the LONG VARCHAR column &lt;code&gt;body&lt;/code&gt;. Then, insert data with some distinct characters and query the table contents:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE table longvc(body long varchar (1048576));
CREATE TABLE

=&amp;gt; insert into longvc values (&amp;#39;На берегу пустынных волн&amp;#39;);
=&amp;gt; insert into longvc values (&amp;#39;Voin syödä lasia, se ei vahingoita minua&amp;#39;);
=&amp;gt; insert into longvc values (&amp;#39;私はガラスを食べられます。それは私を傷つけません。&amp;#39;);
=&amp;gt; insert into longvc values (&amp;#39;Je peux manger du verre, ça ne me fait pas mal.&amp;#39;);
=&amp;gt; insert into longvc values (&amp;#39;zésbaésbaa&amp;#39;);

=&amp;gt; SELECT * FROM longvc;
                      body
------------------------------------------------
 На берегу пустынных волн
 Voin syödä lasia, se ei vahingoita minua
 私はガラスを食べられます。それは私を傷つけません。
 Je peux manger du verre, ça ne me fait pas mal.
 zésbaésbaa
(5 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use &lt;code&gt;REGEXP_NOT_LIKE&lt;/code&gt; to return rows that do not contain the character &lt;code&gt;ç&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM longvc where regexp_not_like(body, &amp;#39;ç&amp;#39;);
                        body
----------------------------------------------------
 Voin syödä lasia, se ei vahingoita minua
 zésbaésbaa
 На берегу пустынных волн
 私はガラスを食べられます。それは私を傷つけません。
(4 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Return all rows that do not contain the characters &lt;code&gt;*ö&lt;/code&gt; and &lt;code&gt;*ä&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM longvc where regexp_not_like(body, &amp;#39;.*ö.*ä&amp;#39;);
                        body
----------------------------------------------------
 Je peux manger du verre, ça ne me fait pas mal.
 zésbaésbaa
 На берегу пустынных волн
 私はガラスを食べられます。それは私を傷つけません。
(4 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pattern match all rows that do not contain the characters &lt;code&gt;z&lt;/code&gt; and &lt;code&gt;*ésbaa&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT * FROM longvc where regexp_not_like(body, &amp;#39;z.*ésbaa&amp;#39;);
                        body
----------------------------------------------------
 Je peux manger du verre, ça ne me fait pas mal.
 Voin syödä lasia, se ei vahingoita minua
 zésbaésbaa
 На берегу пустынных волн
 私はガラスを食べられます。それは私を傷つけません。
(5 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: REGEXP_REPLACE</title>
      <link>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-replace/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-replace/</guid>
      <description>
        
        
        &lt;p&gt;Replaces all occurrences of a substring that match a regular expression with another substring. REGEXP_REPLACE is similar to the &lt;a href=&#34;../../../../../en/sql-reference/functions/data-type-specific-functions/string-functions/replace/#&#34;&gt;REPLACE&lt;/a&gt; function, except it uses a regular expression to select the substring to be replaced.&lt;/p&gt;
&lt;p&gt;This function operates on UTF-8 strings using the default locale, even if the locale is set otherwise.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
If you port a regular expression query from an Oracle database, remember that Oracle considers a zero-length string to be equivalent to NULL, while OpenText™ Analytics Database does not.
&lt;/div&gt;&lt;/p&gt;

&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;REGEXP_REPLACE ( &lt;span class=&#34;code-variable&#34;&gt;string-expression&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;target &lt;/span&gt;
   [, &lt;span class=&#34;code-variable&#34;&gt;replacement&lt;/span&gt; [, &lt;span class=&#34;code-variable&#34;&gt;position &lt;/span&gt;[, &lt;span class=&#34;code-variable&#34;&gt;occurrence&lt;/span&gt;[...] [, &lt;span class=&#34;code-variable&#34;&gt;regexp-modifier&lt;/span&gt;]]]] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The &lt;code&gt;VARCHAR&lt;/code&gt; or &lt;code&gt;LONG VARCHAR&lt;/code&gt; expression to evaluate for matches with the regular expression specified in &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;. If &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt; is in the &lt;code&gt;__raw__&lt;/code&gt; column of a flex or columnar table, cast the string to a &lt;code&gt;LONG VARCHAR&lt;/code&gt; before searching for &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The regular expression to match against &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;. The regular expression must conform with &lt;a href=&#34;http://perldoc.perl.org/perlre.html&#34;&gt;Perl regular expression syntax&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;replacement&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The string to replace matched substrings. If you do not supply a &lt;em&gt;&lt;code&gt;replacement&lt;/code&gt;&lt;/em&gt;, the function deletes matched substrings. The replacement string can contain backreferences for substrings captured by the regular expression. The first captured substring is inserted into the replacement string using &lt;code&gt;\1&lt;/code&gt;, the second &lt;code&gt;\2&lt;/code&gt;, and so on.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;position&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The number of characters from the start of the string where the function should start searching for matches. By default, the function begins searching for a match at the first (leftmost) character. Setting this parameter to a value greater than 1 begins searching for a match at the &lt;em&gt;&lt;code&gt;n&lt;/code&gt;&lt;/em&gt;-th character you specify.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 1&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;occurrence&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Controls which occurrence of a pattern match in the string to replace. By default, the function replaces all matching substrings. For example, setting this parameter to 3 replaces the third matching instance.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 1&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;regexp-modifier&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;One or more single-character flags that modify how the regular expression &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt; is matched to &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;b&lt;/code&gt;: 				Treat strings as binary octets, rather than UTF-8 characters.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;c&lt;/code&gt; (default): 				Force the match to be case sensitive.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;i&lt;/code&gt;: 				Force the match to be case insensitive.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;m&lt;/code&gt;: 				Treat the string to match as multiple lines. Using this modifier, the start of line (&lt;code&gt;^&lt;/code&gt;) and end of line (&lt;code&gt;$)&lt;/code&gt; regular expression operators match line breaks (&lt;code&gt;\n&lt;/code&gt;) within the string. Without the &lt;code&gt;m&lt;/code&gt; modifier, the start and end of line operators match only the start and end of the string.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;n&lt;/code&gt;: 				Match the regular expression operator (&lt;code&gt;.&lt;/code&gt;) to a newline (&lt;code&gt;\n&lt;/code&gt;). By default, the &lt;code&gt;.&lt;/code&gt; operator matches any character except a newline.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;x&lt;/code&gt;: 				Add comments to regular expressions. The &lt;code&gt;x&lt;/code&gt; modifier causes the function to ignore all un-escaped space characters and comments in the regular expression. Comments start with hash (&lt;code&gt;#&lt;/code&gt;) and end with a newline (&lt;code&gt;\n&lt;/code&gt;). All spaces in the regular expression to be matched in strings must be escaped with a backslash (&lt;code&gt;\&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;how-oracle-handles-subexpressions&#34;&gt;How Oracle handles subexpressions&lt;/h2&gt;
&lt;p&gt;Unlike Oracle, OpenText™ Analytics Database can handle an unlimited number of captured subexpressions, while Oracle is limited to nine.&lt;/p&gt;
&lt;p&gt;You can use &lt;code&gt;\10&lt;/code&gt; in the replacement pattern to access the substring captured by the tenth set of parentheses in the regular expression. In Oracle, &lt;code&gt;\10&lt;/code&gt; is treated as the substring captured by the first set of parentheses, followed by a zero. To force this Oracle behavior in the database, use the &lt;code&gt;\g&lt;/code&gt; back reference and enclose the number of the captured subexpression in curly braces. For example, &lt;code&gt;\g{1}0&lt;/code&gt; is the substring captured by the first set of parentheses followed by a zero.&lt;/p&gt;
&lt;p&gt;You can also name captured subexpressions to make your regular expressions less ambiguous. See the &lt;a href=&#34;http://php.net/manual/en/book.pcre.php&#34;&gt;PCRE&lt;/a&gt; documentation for details.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Find groups of word characters—letters, numbers and underscore—that end with &lt;code&gt;thy&lt;/code&gt; in the string &lt;code&gt;healthy, wealthy, and wise&lt;/code&gt;, and replace them with nothing.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_REPLACE(&amp;#39;healthy, wealthy, and wise&amp;#39;,&amp;#39;\w+thy&amp;#39;);
 REGEXP_REPLACE
----------------
 , , and wise
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Find groups of word characters ending with &lt;code&gt;thy&lt;/code&gt; and replace with the string &lt;code&gt;something&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_REPLACE(&amp;#39;healthy, wealthy, and wise&amp;#39;,&amp;#39;\w+thy&amp;#39;, &amp;#39;something&amp;#39;);
         REGEXP_REPLACE
--------------------------------
 something, something, and wise
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Find groups of word characters ending with &lt;code&gt;thy&lt;/code&gt; and replace with the string &lt;code&gt;something&lt;/code&gt; starting at the third character in the string.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_REPLACE(&amp;#39;healthy, wealthy, and wise&amp;#39;,&amp;#39;\w+thy&amp;#39;, &amp;#39;something&amp;#39;, 3);
          REGEXP_REPLACE
----------------------------------
 hesomething, something, and wise
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Replace the second group of word characters ending with &lt;code&gt;thy&lt;/code&gt; with the string &lt;code&gt;something&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_REPLACE(&amp;#39;healthy, wealthy, and wise&amp;#39;,&amp;#39;\w+thy&amp;#39;, &amp;#39;something&amp;#39;, 1, 2);
        REGEXP_REPLACE
------------------------------
 healthy, something, and wise
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Find groups of word characters ending with &lt;code&gt;thy&lt;/code&gt; capturing the letters before the &lt;code&gt;thy&lt;/code&gt;, and replace with the captured letters plus the letters &lt;code&gt;ish&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_REPLACE(&amp;#39;healthy, wealthy, and wise&amp;#39;,&amp;#39;(\w+)thy&amp;#39;, &amp;#39;\1ish&amp;#39;);
       REGEXP_REPLACE
----------------------------
 healish, wealish, and wise
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Create a table to demonstrate replacing strings in a query.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE customers (name varchar(50), phone varchar(11));
CREATE TABLE
=&amp;gt; CREATE PROJECTION customers1 AS SELECT * FROM customers;
CREATE PROJECTION
=&amp;gt; COPY customers FROM stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
&amp;gt;&amp;gt; Able, Adam|17815551234
&amp;gt;&amp;gt; Baker,Bob|18005551111
&amp;gt;&amp;gt; Chu,Cindy|16175559876
&amp;gt;&amp;gt; Dodd,Dinara|15083452121
&amp;gt;&amp;gt; \.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Query the customers, using REGEXP_REPLACE to format phone numbers.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT name, REGEXP_REPLACE(phone, &amp;#39;(\d)(\d{3})(\d{3})(\d{4})&amp;#39;,
&amp;#39;\1-(\2) \3-\4&amp;#39;) as phone FROM customers;
    name     |      phone
-------------+------------------
 Able, Adam  | 1-(781) 555-1234
 Baker,Bob   | 1-(800) 555-1111
 Chu,Cindy   | 1-(617) 555-9876
 Dodd,Dinara | 1-(508) 345-2121
(4 rows)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: REGEXP_SUBSTR</title>
      <link>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-substr/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/match-and-search-functions/regular-expression-functions/regexp-substr/</guid>
      <description>
        
        
        &lt;p&gt;Returns the substring that matches a regular expression within a string. If no matches are found, REGEXP_SUBSTR returns NULL. This is different from an empty string, which the function can return if the regular expression matches a zero-length string.&lt;/p&gt;
&lt;p&gt;This function operates on UTF-8 strings using the default locale, even if the locale is set otherwise.

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
If you port a regular expression query from an Oracle database, remember that Oracle considers a zero-length string to be equivalent to NULL, while OpenText™ Analytics Database does not.
&lt;/div&gt;&lt;/p&gt;

&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;REGEXP_SUBSTR ( &lt;span class=&#34;code-variable&#34;&gt;string-expression&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;pattern &lt;/span&gt;
   [, &lt;span class=&#34;code-variable&#34;&gt;position&lt;/span&gt; [,  &lt;span class=&#34;code-variable&#34;&gt;occurrence &lt;/span&gt;[, &lt;span class=&#34;code-variable&#34;&gt;regexp-modifier&lt;/span&gt; [, &lt;span class=&#34;code-variable&#34;&gt;captured-subexp&lt;/span&gt; ]]... ]] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The &lt;code&gt;VARCHAR&lt;/code&gt; or &lt;code&gt;LONG VARCHAR&lt;/code&gt; expression to evaluate for matches with the regular expression specified in &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;. If &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt; is in the &lt;code&gt;__raw__&lt;/code&gt; column of a flex or columnar table, cast the string to a &lt;code&gt;LONG VARCHAR&lt;/code&gt; before searching for &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;The regular expression to match against &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;. The regular expression must conform with &lt;a href=&#34;http://perldoc.perl.org/perlre.html&#34;&gt;Perl regular expression syntax&lt;/a&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;position&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The number of characters from the start of the string where the function should start searching for matches. By default, the function begins searching for a match at the first (leftmost) character. Setting this parameter to a value greater than 1 begins searching for a match at the &lt;em&gt;&lt;code&gt;n&lt;/code&gt;&lt;/em&gt;-th character you specify.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 1&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;occurrence&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Controls which occurrence of a pattern match in the string to return. By default, the function returns the first matching substring. For example, setting this parameter to 3 returns the third matching instance.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 1&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;regexp-modifier&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;One or more single-character flags that modify how the regular expression &lt;em&gt;&lt;code&gt;pattern&lt;/code&gt;&lt;/em&gt; is matched to &lt;em&gt;&lt;code&gt;string-expression&lt;/code&gt;&lt;/em&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;b&lt;/code&gt;: 				Treat strings as binary octets, rather than UTF-8 characters.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;c&lt;/code&gt; (default): 				Force the match to be case sensitive.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;i&lt;/code&gt;: 				Force the match to be case insensitive.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;m&lt;/code&gt;: 				Treat the string to match as multiple lines. Using this modifier, the start of line (&lt;code&gt;^&lt;/code&gt;) and end of line (&lt;code&gt;$)&lt;/code&gt; regular expression operators match line breaks (&lt;code&gt;\n&lt;/code&gt;) within the string. Without the &lt;code&gt;m&lt;/code&gt; modifier, the start and end of line operators match only the start and end of the string.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;n&lt;/code&gt;: 				Match the regular expression operator (&lt;code&gt;.&lt;/code&gt;) to a newline (&lt;code&gt;\n&lt;/code&gt;). By default, the &lt;code&gt;.&lt;/code&gt; operator matches any character except a newline.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;x&lt;/code&gt;: 				Add comments to regular expressions. The &lt;code&gt;x&lt;/code&gt; modifier causes the function to ignore all un-escaped space characters and comments in the regular expression. Comments start with hash (&lt;code&gt;#&lt;/code&gt;) and end with a newline (&lt;code&gt;\n&lt;/code&gt;). All spaces in the regular expression to be matched in strings must be escaped with a backslash (&lt;code&gt;\&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;captured-subexp&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The group to return. By default, the function returns all matching groups. For example, setting this value to 3 returns the substring captured by the third set of parentheses in the regular expression.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 0&lt;/p&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

The subexpressions are numbered left to right, based on the appearance of opening parenthesis, so nested regular expressions . For example, in the regular expression &lt;code&gt;\s*(\w+\s+(\w+))&lt;/code&gt;, subexpression 1 is the one that captures everything but any leading whitespaces.

&lt;/div&gt;

&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Select the first substring of letters that end with &lt;code&gt;thy&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_SUBSTR(&amp;#39;healthy, wealthy, and wise&amp;#39;,&amp;#39;\w+thy&amp;#39;);
 REGEXP_SUBSTR
---------------
 healthy
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Select the first substring of letters that ends with &lt;code&gt;thy&lt;/code&gt; starting at the second character in the string.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_SUBSTR(&amp;#39;healthy, wealthy, and wise&amp;#39;,&amp;#39;\w+thy&amp;#39;,2);
 REGEXP_SUBSTR
---------------
 ealthy
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Select the second substring of letters that ends with &lt;code&gt;thy&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_SUBSTR(&amp;#39;healthy, wealthy, and wise&amp;#39;,&amp;#39;\w+thy&amp;#39;,1,2);
 REGEXP_SUBSTR
---------------
 wealthy
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Return the contents of the third captured subexpression, which captures the third word in the string.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT REGEXP_SUBSTR(&amp;#39;one two three&amp;#39;, &amp;#39;(\w+)\s+(\w+)\s+(\w+)&amp;#39;, 1, 1, &amp;#39;&amp;#39;, 3);
 REGEXP_SUBSTR
---------------
 three
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
  </channel>
</rss>
