I have a input field with this name:
myinput[something][etc]
How can I get the contents from the last [] part from it? i.e. etc in this case?
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.
You can use a regular expression to match whatever is in between the last pair of
[]. Because[and]have special meaning in regexp (they are used to delimit character classes), you have to escape them with\. The entire match (aside from the[and the]) is anchored at the end of the string using$.