What is the replacement of drupal_match_path()?
New PathMatcher service reports that the path.matcher service was introduced to deprecate most procedural functions in the path.inc file with its methods.
In particular, the equivalent of $path_matches = drupal_match_path($path, $patterns); is the following code.

$path_matches = \Drupal::service('path.matcher')-&gt;matchPath($path, $patterns);


The same service is used to check if the currently viewed page is the front page.

$is_front = \Drupal::service('path.matcher')-&gt;isFrontPage();


As usual, injecting the dependency is preferred over calling \Drupal::service().