Removing string inside brackets

前端 未结 5 1643
渐次进展
渐次进展 2021-01-24 12:42

Good day!

I would like some help in removing strings inside the square brackets and including the square brackets.

The string looks like this:

$str

5条回答
  •  攒了一身酷
    2021-01-24 13:05

    Use a regular expression something like /\[.*?\]/. The backslashes are necessary, otherwise it will try to match any single character ., *, or ? instead.

提交回复
热议问题