【发布时间】:2014-08-20 15:54:07
【问题描述】:
我正在尝试创建一个正则表达式,用于提取字符串从开头到结尾的所有字符串,字符串末尾的冒号 (:) 除外。
字符串是:
ORA-06550: line 10, column 33:
ORA-20000: Schema "TEST" does not exist or insufficient privileges
PLS-00201: identifier 'A' must be declared:
在 Perl 语言的一个正则表达式中,我想捕获以下字符串:
ORA-06550: line 10, column 33
ORA-20000: Schema "TEST" does not exist or insufficient privileges
PLS-00201: identifier 'A' must be declared
到目前为止,我有以下正则表达式 (see online)::
/^(.*)(?::)?$/gm
我的问题是如何构造一个正则表达式,从第一个和第三个字符串中去掉冒号,同时捕获所有第二个字符串。
【问题讨论】: