M
M
Mikhail Nikityuk2020-11-28 21:19:14
PHP
Mikhail Nikityuk, 2020-11-28 21:19:14

What regular expression can find the character ")"?

I want to use preg_replace () to find and replace all the symbols of the arc ")". how to do it?
I am familiar with the work of the preg_replace () function, the problem is that it does not find this character.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-11-28
@Mehal7

Escape Or use a character class\)
preg_replace('~\)~', '', $text);
preg_replace('~[)]~', '', $text);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question