How can I extract below parameters with Regex using the RE2 syntax (not all features are available)?
What I would need is to extract (different Regex for each):
- Parameter that appears after third occurrence of
_from the end of the string and until second occurrence of_(from the end of the string) - Parameter that appears after second occurrence of
_from the end of the string and until first occurrence of_(from the end of the string) - Parameter that appears after first occurrence of
_from the end of the string and until first occurrence of.in the string (from the end of the string) - Everything up until first occurrence of
.from the end of the string
Lets say that we have below string:
- Parameter1_Parameter3_Parameter4_ParamaterA_ParameterB_ParamaterC.mp4
In this case I want to extract:
- ParameterA
- ParameterB
- ParameterC
- mp4
Couple of notes:
- There can be a lot of additional strings in between "_" at the start of the string
- Parameter A, ParameterB, ParameterC and "." position are always in same spot (if looking from the end of the string)
- mp4 can be of any length, it's not fixed to 3 characters
Best thing I did so far is to extract _ParameterA_ParameterB_ParameterC.mp4 with ((?:_[^_]*){3})$ but that's not what I need.
Also figured out how to pull ".mp4" ( (\..*)$ )but can't figure out how to get it without ..
I figured out how to pull "mp4" with RE2. It's ([^.]*)$.