Doc: alphabetize the regexp_foo() function descriptions in 9.7.3.
authorTom Lane
Sat, 31 Jul 2021 19:35:27 +0000 (15:35 -0400)
committerTom Lane
Sat, 31 Jul 2021 19:35:27 +0000 (15:35 -0400)
For no visible reason (other than historical accident no doubt),
regexp_replace() was out of order.  Re-order to match the way
that these functions are listed in 9.4.  (That means substring()
remains first, because it's SQL-standard and the rest aren't.)
I've not touched the text other than to move it.  This is just
to reduce confusion in the diffs for upcoming additions.

doc/src/sgml/func.sgml

index d83f39f7cd02fc3123f7057163b8535f3acce074..a5b6adc4bb7042ab229df6329a2dbe4d6ca29de2 100644 (file)
@@ -5377,15 +5377,15 @@ substring('foobar' similar '#"o_b#"%' escape '#')    NULL
    
     substring
    
-   
-    regexp_replace
-   
    
     regexp_match
    
    
     regexp_matches
    
+   
+    regexp_replace
+   
    
     regexp_split_to_table
    
@@ -5542,46 +5542,6 @@ substring('foobar' from 'o(.)b')   o
 
    
 
-    
-     The regexp_replace function provides substitution of
-     new text for substrings that match POSIX regular expression patterns.
-     It has the syntax
-     regexp_replace(source,
-     patternreplacement
-     flags ).
-     The source string is returned unchanged if
-     there is no match to the pattern.  If there is a
-     match, the source string is returned with the
-     replacement string substituted for the matching
-     substring.  The replacement string can contain
-     \n, where n is 1
-     through 9, to indicate that the source substring matching the
-     n'th parenthesized subexpression of the pattern should be
-     inserted, and it can contain \& to indicate that the
-     substring matching the entire pattern should be inserted.  Write
-     \\ if you need to put a literal backslash in the replacement
-     text.
-     The flags parameter is an optional text
-     string containing zero or more single-letter flags that change the
-     function's behavior.  Flag i specifies case-insensitive
-     matching, while flag g specifies replacement of each matching
-     substring rather than only the first one.  Supported flags (though
-     not g) are
-     described in .
-    
-
-   
-    Some examples:
-
-regexp_replace('foobarbaz', 'b..', 'X')
-                                   fooXbaz
-regexp_replace('foobarbaz', 'b..', 'X', 'g')
-                                   fooXX
-regexp_replace('foobarbaz', 'b(..)', 'X\1Y', 'g')
-                                   fooXarYXazY
-
-   
-
     
      The regexp_match function returns a text array of
      captured substring(s) resulting from the first match of a POSIX
@@ -5684,6 +5644,46 @@ SELECT col1, (SELECT regexp_matches(col2, '(bar)(beque)')) FROM tab;
     
    
 
+    
+     The regexp_replace function provides substitution of
+     new text for substrings that match POSIX regular expression patterns.
+     It has the syntax
+     regexp_replace(source,
+     patternreplacement
+     flags ).
+     The source string is returned unchanged if
+     there is no match to the pattern.  If there is a
+     match, the source string is returned with the
+     replacement string substituted for the matching
+     substring.  The replacement string can contain
+     \n, where n is 1
+     through 9, to indicate that the source substring matching the
+     n'th parenthesized subexpression of the pattern should be
+     inserted, and it can contain \& to indicate that the
+     substring matching the entire pattern should be inserted.  Write
+     \\ if you need to put a literal backslash in the replacement
+     text.
+     The flags parameter is an optional text
+     string containing zero or more single-letter flags that change the
+     function's behavior.  Flag i specifies case-insensitive
+     matching, while flag g specifies replacement of each matching
+     substring rather than only the first one.  Supported flags (though
+     not g) are
+     described in .
+    
+
+   
+    Some examples:
+
+regexp_replace('foobarbaz', 'b..', 'X')
+                                   fooXbaz
+regexp_replace('foobarbaz', 'b..', 'X', 'g')
+                                   fooXX
+regexp_replace('foobarbaz', 'b(..)', 'X\1Y', 'g')
+                                   fooXarYXazY
+
+   
+
     
      The regexp_split_to_table function splits a string using a POSIX
      regular expression pattern as a delimiter.  It has the syntax