我有这个代码,需要一个正则表达式来获得从PL SQL代码得到的约束和检查行
创建表格
"OWB_RUN"."WITHOUT_RESCHEDULING_OFFER"
( "RESCHEDULING_OFFER_ID" NUMBER NOT NULL ENABLE,
"OFFER_DAY" DATE,
"F_OFFER_MADE" NUMBER(1,0),
"F_ACCEPTED" NUMBER(1,0),
"CIF" VARCHAR2(8),
CONSTRAINT "FS_WITHOUT_RESCHED_OFFERS_N1" CHECK (cif IS NOT NULL
) ENABLE,
CONSTRAINT "FS_WITHOUT_RESCHED_OFFERS_N2" CHECK (offer_day IS NOT NULL
) ENABLE,
CONSTRAINT "FS_WITHOUT_RESCHED_OFFERS_N3" CHECK (f_accepted IS NOT NULL
) ENABLE,
CONSTRAINT "FS_WITHOUT_RESCHED_OFFERS_C1" CHECK (f_accepted IN (0,1,2)
) ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS NOLOGGING
STORAGE(INITIAL 1048576 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "APPL_WORK_TBL"
PARALLEL
我想要这样的输出:
['CONSTRAINT "FS_WITHOUT_RESCHED_OFFERS_N1" CHECK (cif IS NOT NULL)',
'CONSTRAINT "FS_WITHOUT_RESCHED_OFFERS_N2" CHECK (offer_day IS NOT NULL)',
'CONSTRAINT "FS_WITHOUT_RESCHED_OFFERS_N3" CHECK (f_accepted IS NOT NULL)',
'CONSTRAINT "FS_WITHOUT_RESCHED_OFFERS_C1" CHECK (f_accepted IN (0,1,2))']
2条答案
按热度按时间qvtsj1bj1#
假设
text
是存储输入的变量,你可以尝试:输出:
aemubtdh2#
下面的正则表达式就可以做到这一点:
你可以在这里找到这个正则表达式的解释:https://regexr.com/7cm9j