猿问

替换字符串中的特定单词

我发现很难将字符串的单词更改为固定的单词。下面是字符串的内容


 CREATE TABLE "USER1"."TEST_TAB"

   (    "O_ID" CHAR(15),

        "CREATED_DATE" DATE DEFAULT SYSDATE,

        "EVENT_ID" NUMBER,

        "LOD" BLOB,

        "TOPIC" VARCHAR2(765),

        "SCHEMA_ID" VARCHAR2(36),

        "RECORD_ID" CHAR(15),

         CONSTRAINT "R_PKCONDUIT_MESSAGE" PRIMARY KEY ("O_ID", "TOPIC", "EVENT_ID", "CREATED_DATE") ENABLE

   ) O INDEX COMPRESS 2 PCTFREE 10 INITRANS 2 MAXTRANS 255  NOLOGGING

  TABLESPACE "D01"

  STORAGE(

  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)

 PCTTHRESHOLD 50

 LOB ("LOD") STORE AS BASICFILE (

  DISABLE STORAGE IN ROW CHUNK 8192 RETENTION

  NOCACHE LOGGING

  STORAGE(

  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))

  PARTITION BY HASH ("O_ID")

 (PARTITION "CONDUIT_MESSAGE01"

 LOB ("LOD") STORE AS BASICFILE "LOD01"(

  TABLESPACE "D01" )

  TABLESPACE "D01" ,

 PARTITION "CONDUIT_MESSAGE02"

 LOB ("LOD") STORE AS BASICFILE "LOD02"(

  TABLESPACE "D02" )

  TABLESPACE "D02" ,

 PARTITION "CONDUIT_MESSAGE03"

 LOB ("LOD") STORE AS BASICFILE "LOD03"(

  TABLESPACE "D03" )

  TABLESPACE "D03" ,

 PARTITION "CONDUIT_MESSAGE04"

 LOB ("LOD") STORE AS BASICFILE "LOD04"(

  TABLESPACE "D04" )

  TABLESPACE "D04" ,

 PARTITION "CONDUIT_MESSAGE05"

 LOB ("LOD") STORE AS BASICFILE "LOD05"(

  TABLESPACE "D05" )

  TABLESPACE "D05" ,

 PARTITION "CONDUIT_MESSAGE06"

 LOB ("LOD") STORE AS BASICFILE "LOD06"(

  TABLESPACE "D06" )

  TABLESPACE "D06"

/

试图将 TABLESPACE "D01" .... TABLESPACE "D06" 更改为 TABLESPACE "COPY_TBS" 的固定名称


string.replace('TABLESPACE \"D[0-9][0-9]+\"','TABLESPACE COPY_TBS')

似乎无法正常工作。有什么办法可以改变这个字符串。


芜湖不芜
浏览 188回答 2
2回答
随时随地看视频慕课网APP

相关分类

Python
我要回答