What’s the regex to match a square bracket? I’m using \\] in a pattern in eregi_replace, but it doesn’t seem to be able to find a ]…
What’s the regex to match a square bracket? I’m using \\] in a pattern
Share
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.
\]is correct, but note that PHP itself ALSO has\as an escape character, so you might have to use\\[(or a different kind of string literal).