If you are using php 7.3, you have to escape the hyphen
Php 7.3 is using PCRE2, so now the hyphen needs to be escaped in regex patterns.
preg_match('/[\w-.]+/', ''); // this will not work in PHP7.3
preg_match('/[\w\-.]+/', ''); // the hyphen need to be escaped
new regex with hyphen escaped :
const URL_PATTERN = '/^(http(s)?:\/\/)?((\d+\.\d+\.\d+\.\d+)|(([\w\-]+\.)+([a-z,A-Z][\w\-]*)))(:[1-9][0-9]*)?(\/?([\w\-.\,\/:%+@&*=~]+[\w\- \,.\/?:%+@&=*|]*)?)?(#(.*))?$/';
I had a problem like yours but with a rss widget, and found this solution.
Core can work with php7.3+ with littles changes and with upgrade of vendors and libraries.
There is more work on third party plugins.
It might be that first impression.
Simi Valley Concrete And Masonry