I'm having an issue, converting REGEXP_SUBSTR from ORACLE to REG_EXTRACT in PWC (9.5.1).
In Oracle i have the statement below:
select
regexp_substr('AA 12345678 * 123','[^' || CHR (9) || ']+', 1,1) FIELD1,
regexp_substr('AA 12345678 * 123','[^' || CHR (9) || ']+', 1,2) FIELD2,
regexp_substr('AA 12345678 * 123','[^' || CHR (9) || ']+', 1,3) FIELD3,
regexp_substr('AA 12345678 * 123','[^' || CHR (9) || ']+', 1,4) FIELD4
from DUAL;
Result:
FIELD1=AA
FIELD2=12345678
FIELD3=*
FIELD4=123
In PWC i've created a transformation with 4 ports with a similar regular expression:
FIELD1=REG_EXTRACT('AA 12345678 * 123','([^\s]+)', 1,1)
FIELD2=REG_EXTRACT('AA 12345678 * 123','([^\s]+)', 1,2)
FIELD3=REG_EXTRACT('AA 12345678 * 123','([^\s]+)', 1,3)
FIELD4=REG_EXTRACT('AA 12345678 * 123','([^\s]+)', 1,4)
Result:
FIELD1=NULL
FIELD2=NULL
FIELD3=NULL
FIELD4=NULL
Why i'm getting NULL values in FIELD[1-4] ? Can anyone help me with this question ?
Thank You !