Regexp_substr on a rfe.file_contents of a .txt

I am trying to extract some elements from a text file (.txt) using a regexp_substr.

I managed to retrieve the content of my file using read_file_text:

select regexp_substr(rfe.file_contents, 'START_FILE', 1, 1, 'm') as DoesntWork
from   Files@os('c:\My\Path', 'Myfile.txt', true) fle
join   read_file_text@os(fle.file_path) rfe

Then, in my select, I try to do my regexp_substr on rfe.file_contents. I specify my file, what I want to retrieve, that I want the first occurrence, 1 for appearance and ‘m’ as we have a multi-line file.

However if in what I want to retrieve I put my regex function:

‘((?<=^(TYP)(=)(2))|(?<=^(TYP)(=)(2))|(?<=^(TYP)(=)(2))|(?<=^(TYP)(=)(2))
(^(DATI)\d*(=)(\d*))
^(STATION)(\d*)(_)(NR)(\d*)(=)(\d*)’

or any other regex function asking for more than one character it returns nothing. If, on the other hand, I put a simple ‘\d’ or ‘S’, it works very well.

I have done several tests:

I can lower or upper rfe.file_contents without any problem, regexp_replace has the same problem, it only works on one character, the replace function too. I tried to convert rfe.file_contents using substr and to_char. Nothing works.

I finally succeeded by hard-coding my file into my regexp_substr:

I don’t see what the problem is. I hope you can help me.

It is not clear for me what the actual problem and intended outcome is.

Can you provide a sample a specific example using a SQL-statement?

Can you provide functionally what the intended outcome is?

Please note that the use of carriage return, line feed and new-line characters is recommended against; a new-line character can have different meanings on different platforms. It is strongly recommended to make the expected characters explicit using chr(13) and/or chr(10).

This question was automatically closed after at least 2 weeks of inactivity after a possible solution was provided. The last answer given has been marked as a solution.

Please ask a new question via a separate topic if the problem occurs again. Please include a link to this topic in the new question by pasting its URL into the text.