我有绳子Organization, INC..Truck/Equipment Failure |C。我想在组织名称之后(在两个“ ..”字符之后)和管道字符之前获取子字符串。因此,输出字符串应为- Truck/Equipment Failure。你能帮忙吗?
Organization, INC..Truck/Equipment Failure |C
Truck/Equipment Failure
我一直在尝试形成这样的正则表达式,但似乎没有用。
select regexp_substr('Organization, INC..Truck/Equipment Failure |C', '[^.]+',1,2) from dual;
您可以使用它。
SELECT REGEXP_SUBSTR ('Organization, INC..Truck/Equipment Failure |C', '([^.]+)\|', 1, 1, NULL, 1) FROM DUAL;
编辑: 这将恰好匹配两个点,后跟一个或多个字符,|直到字符串末尾为止。
|
SELECT REGEXP_SUBSTR ('Organization, INC..Truck/Equipment Failure', '\.{2}([^|]+)', 1, 1, NULL, 1) FROM DUAL;