[1.7.x] Fixed #23639 -- Fixed doc error in RegexValidator.regex

Thanks to @claudep for the report and the original patch.

Backport of c48a29a02a457cfdb1cff11009401459ba24e870 from master.