Answer the question
In order to leave comments, you need to log in
Regular url with user_id?
There is a regex for ui validation , but
I need to catch the transition to /info/{ui}
did so, but for some reason it doesn’t work
/^[a-zA-Z0-9_]+$/
/^\/info\/^[a-zA-Z0-9_]+$/.test(url)
Answer the question
In order to leave comments, you need to log in
In the expression - regex is inside slashes, i.e. the expression itself = .
The first character of this expression means "the beginning of the line"; and the last character of this expression means "end of line".
If you want to add something else to the expression (here you add ), then the characters of the beginning and end of the line must be pressed to the edges. And inside the expression (not along the edges) they should not be. /^[a-zA-Z0-9_]+$/
^[a-zA-Z0-9_]+$
/info/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question