Update contentitem Set "content" = regexp_replace ("content", '(\ n)', '<br/> ') Where Isdeleted = false And "content "~ * '\ N ';
The main knowledge points used are:
Regular Expression matching:
Operator |
Description |
Example |
~ |
Match regular expressions, case sensitive |
'Thomas '~ '. * Thomas .*' |
~ * |
Match regular expression, case-insensitive |
'Thomas '~ * '. * Thomas .*' |
!~ |
Does not match regular expression, case-sensitive |
'Thomas '!~ '. * Thomas .*' |
!~ * |
Does not match the regular expression. It is case-insensitive. |
'Thomas '!~ * '. * Vadim .*' |
Function: regexp_replace (string text, pattern text, replacement text [, flags text])
Note: If no match exists Pattern Sub-string, then Returns the unmodified Source String. If a match exists Source The corresponding substring in the string will be Replacement Replace the string. Replacement The string can contain \ N , This In N Yes 1 To 9 , It indicates N Items The section of the arc subexpression is inserted at this position and can contain \& Indicates that the entire pattern should be inserted. String. For example If you need to put a text Reverse Oblique Bar on Replace the text Write \\ .
Example: regexp_replace ('thomAs ','. [Mn]A. ', 'M')= THM
Function: Replace (string text, from text, to text)
Note: replace all occurrences in string of substring fr OM with substring to replace a substring of a character Into another substring
Example: ('abcd E Fabcdef ', 'CD ' , 'Xx') = abxxefabx XeF