I'm using the following `PCRE` expression with `preg_match` to check if the value I want is a digit or not.

```
(?P<id>[\d]+)

```

It works, but now I want it to match the same conditions except if the whole content equals `0` (zero).

**Example result**

```
1    valid
10   valid
0    invalid

```

**Expression context**

```
#^(?P<controller>.*?|home)(?:/(?P<action>.*?|index)(?:/(?P<id>[\d]+))?)?$#uD

```