I have a text file filled with sentences with unique pattern. The unique pattern is:
NAME [ e_NAME ]
simple rule: the "NAME" must follow after "e_" if the "e_" appearers inside the brackets!
The problem comes out when the string is complicated. I'll show the end point situations that may be hard to analyse:
Lines that won't match the rule:
(1) NAME1[blabla+NAME2[blabla+e_BAD2]+e_NAME1] (2) NAME1[blabla] + NAME2[e_BAD2] (3) NAME1[NAME2[blabla+e_BAD2]] + NAME3[e_BAD3] (4) NAME1[e_NAME1BAD1] -> means it has to be only NAME1
Lines that match the rule:
(1) FOO1[blabla + 1] (2) [blalbla] + bla (3) bla + blabla (4) FOO1[ccc + ddd + FOO2[e_FOO2]] = 123 (5) FOO1[cc + FOO2[ dd ] ] + FOO3[e_FOO3]
I already asked this question but I couldn't catch this end points...