Answer the question
In order to leave comments, you need to log in
How to write a regular expression to clean strings from square brackets at the beginning and end?
There is a line: [-]
We need a regular expression for cleaning with (preg_replace) from "[]", the most important thing is that "[" is cleaned from the beginning of the line, and "]" from the end.
I tried to do this: "/^[$]/" and "/^\[$\]/", but there is no result.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question