Currently I am working on regex_search and it works fine. I can get the matched data but I only getting the first occurrence of the matched data. Is it possible to get list of all the occurrences using regex_search? Or if there is some other way to do it?
If your search succeeded you get the FirstIndex returned.
With the SUBSTR function you kan create a substring, only containing the part from FirstIndex to the end. On that part you can do a Regex_Search again. Repeat these steps until Regex_Search does not find anything anymore.
Regex_Search will return first occurrence only. I may suggest to use String_Split using your pattern so it will split text and return list of which will helps you to know number of occurrence of your pattern.
You can find more details about String_Split here
1. Split the string using Substr() function.
2. Apply Regex_Search for every element from the string
3. Store the FirstIndex returned into a structure or entity
4. Then you will have the count of occurrence of the matched data
Thanks guys for your quick response. Much appreciated!