I have a list of page events of all types in a column value ordered by time asc that I got using listagg method.
listagg(page,';') within group (order by time)
I want to get the occurrence of the last match that matches the regex
regexp_substr(event_list,'/step[0-9]+[^;]*')
According to the docs "A positive integer that indicates the position within source_string to begin searching. The position is based on the number of characters, not bytes, so that multibyte characters are counted as single characters. The default is 1. If position is less than 1, the search begins at the first character of source_string. If position is greater than the number of characters in source_string, the result is source_string."
Based on this I need to know the exact occurrence number which I do not know.
How to get the last match in this case?
eg :
/step1;somethging;somethig;/step2;something;/step3;something;
I want to match step3.
PS: Ordering by time desc and getting the first match is not an option here.