I have a problem with regexp, and am looking for suggestions.
The requirement is to examine a string, which is of unknown length, and contains new line characters, which are interspersed with desired data.
Wherever a line starts with [ABODS] it is required to detect the data thereafter, which is characters of text followed by a space and a comma.
For example
Is a single string, but because it contains new line charactes it displays as above.
From the above, I want the single C which comes after the first [ABODS], and the characters after the second.
Desired output is
I can detect the lines which start with ABODS, using regular expressions in multi-line mode, but can't figure out how to detect the end of line.
Thus far I have
as an ABODS detection mechanism, but am struggling to take it further.
Regards
T
The requirement is to examine a string, which is of unknown length, and contains new line characters, which are interspersed with desired data.
Wherever a line starts with [ABODS] it is required to detect the data thereafter, which is characters of text followed by a space and a comma.
For example
Code:
:
[PANEL] NBS
[ABODS] C
[ABCOM] comment
[CELLS] 1 2 3 4 5 6 7 8 9 10
[RESLT] IAT - - + - - - - - - -
[RESLT] ENZYME - - - - - + - - - +
[ABODS] Cw, S, k, e
Is a single string, but because it contains new line charactes it displays as above.
From the above, I want the single C which comes after the first [ABODS], and the characters after the second.
Desired output is
Code:
C
Cw, S, k, e
I can detect the lines which start with ABODS, using regular expressions in multi-line mode, but can't figure out how to detect the end of line.
Thus far I have
Code:
SELECT REGEXP_SUBSTR('[ABODS] C ','^\[ABODS\]')
FROM DUAL;
Regards
T