Luca Mainieri
Luca Mainieri

Reputation: 35

Regular expression to match pattern and any number.

I have a URL pattern which can be

my-domain.com/my-path/prod234728749.html

I want to create a rule to match any URL combination with:

"/my-path/prod" + anycombination-of-number + ".html"

The combination can be a combination of different numbers of unknown length.

Upvotes: 0

Views: 33

Answers (1)

depperm
depperm

Reputation: 10746

\d+ or [0-9]+ for combination. The complete would be /my-path/prod[0-9]+\\.html or /my-path/prod\d+\\.html

Upvotes: 2

Related Questions