-5

This is my code. I am wondering what "((?2))" meaning in PHP. thank you for answering.

$p1 = '/^((\d++(\.\d+)?|\((?2)\))((\+|\/|\*|-)(\d++(\.\d+)?|(?2)))*)$/';
  • Does this answer your question? [Reference - What does this regex mean?](https://stackoverflow.com/questions/22937618/reference-what-does-this-regex-mean) – El_Vanja Apr 13 '21 at 10:48

1 Answers1

0

From https://regex101.com/ :

2nd Alternative ((?2))
( matches the character ( literally (case sensitive)
(?2) recurses the 2nd subpattern
) matches the character ) literally (case sensitive)

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335