I have strings like
View_Export_US_Horizontals_Ultimate_DirectionalSurveys
I want to extract matches like
[["US_Horizontals", "Ultimate", "DirectionalSurveys"]] //String Ultimate may or may not be present
I have the following RegEx, /^View_Export_(US\_(GoM|Horizontals|Onshore))((_Ultimate)?)_(\w+)/
but i get the following matches array
[["US_Horizontals", "Horizontals", "_Ultimate", "_Ultimate", "DirectionalSurveys"]]
How do i skip strings like Horizontals & _Ultimate and just get an array like
[["US_Horizontals", "Ultimate", "DirectionalSurveys"]]
Or
[["US_Horizontals", "DirectionalSurveys"]]