I need to parse (extract data - don't need to replace anything).
Test string: MAIN_HEADER:(ANOTHER_HEADER([DUMDUM:(BAH_123),OOPS,YEAH:(GAGA)]))
need to output:
First component:
MAIN_HEADER
- only caps alpha and underscoreSecond component:
ANOTHER_HEADER:([DUMDUM:(BAH_123),OOPS,YEAH:(GAGA)])
- caps alpha, numbers, square and round brackets, commas, colons in any combination
I can extract second component with ^\(([a-zA-Z0-9_:,\(\)\[\]]*)\)$
but I don't know how to do 2 different matches to split components.