Need help in solving this regex issues, I am stuck at, and not able to solve. I am using nodejs 6.10
For example following are the incoming patterns
- test
- test123
- test/
I need help creating a regex match so -
- only test is matched, and not test123 or test/ or
- for test123, it shall not prematch at test
Presently I am using the following rules for redirect
‘^/test /test-videos.html [R=302,L]’
'^/test/ /test/videos.html [R=302,L]’
'^/test123 /test/test-videos.html [R=302,L]’
GET www.domain.com/test
It matches test and return 302 on /test-videos.html
on 302 when the request reaches for /test-videos.html again at the server
test is matched again, and a 302 is returned with /test-videos.html-videos.html,
and again the same on that request, so it gets into an unending loop of
/test-videos.html-videos.html-videos.html
/test-videos.html-videos.html-videos.html-videos.html-videos.html-videos.html-videos.html-videos.html-videos.html
Need help with an expression which matches test with nothing succeeding it.