Using Ubuntu 21.10 and trying to install php-dev, getting libpcre2-dev : Depends: libpcre2-8-0

we could revert packages from ppa's that are newer as from ubuntu sources with apt pinning.

sudo apt install  apt-show-versions

To identify how many packages are involved run

 apt-show-versions | fgrep newer

If are not many packages listed you have a good chance to fix brocken depencecies.

community wiki

The right values you can get from the output from

apt-cache policy

Note: Make a backup first and draw an iso so you can make a clean install. apt pinning is the last ditch to set things right It can work but it is not guaranteed