I want to get the position of a word in a field that has the following data with the delimiter as "->":
Example Col1:*
Row 1| "ACT -> BAT -> CAT -> DATE -> EAT"
Row 2| "CAT -> ACT -> EAT -> BAT -> DATE"
I would like to lets extract the position of a value which is is ANOTHER COLUMN.
Example Col2:
Row 1| CAT
Row 2| ACT
Output would be -
Row 1| 3
Row 2| 2
Ive tried regex_instr and instr but they both return position of the alphabet i think not the word.
Also tried this but it doesnt work:
select *, array_length(split(regexp_extract(col1, col2), '->'))

