I just don't understand, why this matches a whole line:
'([^' || chr ( 10 ) || ']*)(' || chr ( 10 ) || '|$)'
What I understand so far is:
(' || chr ( 10 ) || '|$)
matches the end of a line $
OR a linebreak chr ( 10 )
But why does THIS
([^' || chr ( 10 ) || ']*)
match ANYTHING before my first linebreak?
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
I just don't get it.