1

Oracle 11.g 手順を使用しています。この例はREGEXP_REPLACE、2 つの引数 (input と pattern) のみを使用して見つけました。動作しますが、最適ではありません。テキストbase64の後、テキストの前にREGEXP_REPLACE発生する特定のテキスト文字列の可変回数の発生をループするために使用しようとしています" /> 1回の発生で機能させることはできますが、できませんきちんとループさせます。

Declare p_html    clob;
        l_image_clob  clob;
        l_image_count number;
Begin
p_html := '<p>Some header text base64,one start here and then this is the end one" /></p><p>Some header text base64,two start here and then this is the end two" /></p>';
l_image_count := REGEXP_COUNT(p_html, 'base64', 1, 'i');
If l_image_count > 0 Then
  For i In 1..l_image_count Loop
    l_image_clob := REGEXP_REPLACE(p_html, '(.*base64,)|(" />.*)');
    dbms_output.put_line(l_image_clob);
    -- code to process each occurrence individually.
  End Loop;
End If;
End;

データの結果について知りたいのは次のとおりです。

one start here and this is the end one 
two start here and this is the end two

上記の例は次を返します。

two start here and this is the end two
two start here and this is the end two

いくつかのオプションを試しましたREXEXP_REPLACEが、変数で機能させることができないようですi

4

1 に答える 1