我只是不明白,为什么这匹配整行:
'([^' || chr ( 10 ) || ']*)(' || chr ( 10 ) || '|$)'
到目前为止我所理解的是:
(' || chr ( 10 ) || '|$)
匹配行$
或换行符chr ( 10 )
但为什么呢?
([^' || chr ( 10 ) || ']*)
在我的第一次换行前与任何人匹配?
with Text as
(select 'This is my first line'
|| chr ( 10 )
|| 'This is my second line'
|| chr ( 10 )
|| 'This is my third line'
as Astr
from dual)
select regexp_substr ( Astr
,'([^' || chr ( 10 ) || ']*)(' || chr ( 10 ) || '|$)' ) First_Line
from Text
我只是不明白。