D
D
Denis Shevchenko2017-10-17 22:57:26
PHP
Denis Shevchenko, 2017-10-17 22:57:26

How to write a regular expression for pattern checking?

I am doing some functionality on the site, where the admin indicates on which pages to perform a certain action, and he indicates by prescribing a URL template. For example: "*/projects/*/1080". Accordingly, asterisks are any value.
How can I check if the current URL is included in a given pattern?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Fov, 2017-10-17
@Roman-Fov

.+\/projects\/.+\d+$
or
.+\/projects\/.+\/1080$

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question