How do I convert a string like node/1 into a RouteMatch or Url object? I'm creating a text filter that modifies links. I am processing all the hrefs, and I want to load a RouteMatch or Url object for all valid urls like "/node/1". I need this to also handle i18n URLs. How do I convert a string like node/1 into a RouteMatch or Url object?
One way is to use the path validator service:

$url = \Drupal::service('path.validator')-&gt;getUrlIfValid($path)


I don't think that can handle URL's prefixed with the langcode if that's what you mean. That's usually handled/stored separately.