Could you explain how to get the substring between tokens [ and ;
The original string:
a [
b [
text1;
text2;
c [
text3;
text4;
]
]
]
And that I want:
text1;
text2;
text3;
text4;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A quick approach would be to search from the back for a
';', then search back for'['starting from that position, and split the resulting string at the semicolons. Repeat the same process until you can no longer find a semicolon';'.A better approach would be to write a simple recursive descent parser with a single rule: the detection would be a lot more reliable if errors in the source are present.