Regex to check for a number in the url using Twig
09:51 05 Nov 2015

This wouldnt be a big problem if I had known Twig a little more. Here is my code, I am trying to check whether the url contains number in it.

{% set x = req.path %}
{% set matches = x|regex_match('~[\d\.]+$~') %}

{% set matches = x|regex_match('~[0-9]*$+~') %}

none of these work

thanks in advance

php regex symfony twig