Ваше регулярное выражение, кажется, не в порядке, попробуйте выражение <start>(.)*?<end>
WITH da AS (
SELECT '<start><cust_name><start><cust_name><this field has long string><end>' AS cust_info FROM dual UNION ALL
SELECT 'name_test' AS cust_info FROM dual
) SELECT REGEXP_REPLACE(cust_info,'<start>(.)*?<end>','') FROM da;
Попробуйте
UPDATE
customer
SET
cust_info = REGEXP_REPLACE(cust_info, '<start>(.)*?<end>', '')
WHERE
user_id = 123;
Объяснение: -
<start> //Matches literal <start>
(.) //Matches any character except linebreaks
* //Matches 0 or more of the preceding token of (.)
? //Makes the preceding quantifier lazy, causing it to match as few characters as possible
<end> //Matches literal <end>
В случае, если ваша строка имеет разрывы строк, используйте параметр match_parameter, чтобы поместить его в заключение
REGEXP_REPLACE ( cust_info, '<start>(.*?)*?<end>' , '' , 1 , 1 , 'n' )
На основе:
REGEXP_REPLACE ( source_string, search_pattern
[, replacement_string
[, star_position
[, nth_occurrence
[, match_parameter ]
]
]
]
)
Следовательно:
UPDATE
customer
SET
cust_info = REGEXP_REPLACE ( ID_DESC, '<start>(.*?)*?<end>' , '' , 1 , 1 , 'n' )
WHERE
user_id = 123;