I’m trying to parse string like:
.A.B[C].D(E).F("(G) / {H})", "1" == "1").I.J[K]
where A,B,I,J are property names, D,F method names, E, "(G) / {H})", "1" == "1" method parameters and C and K index values. . The parameters can contain any characters and the string may contain any number of properties and/or methods.
I’m looking for a regex that would do that job. So far I came up with
(?<=\.)(?< PropertyOrMethodName>\w+)((\\[(?< Index>\w+)\\])|((?< Open>\\()(?< Parameters>.+)(?<-Open>\\))(?(Open)(?!))))?
but it’s not good e.g. for the above sample captures D(E).F("(G) / {H})", "1" == "1") together.