jaked_150553
Sep 09, 2014Nimbostratus
using regex with if condition and ends_with
I have requirement to check the end of a uri and check for pattern in it and take decisions based on it. example urls would be like this -
http://example.com/test/folder/dir-test http://example.com/test/folder/dir-test.xml http://example.com/test/folder/dir-test?varbs=123
how do i look for '-test' at the end of the uri and redirect based on above mentioned urls? 'test' can be found in other parts of the uri also. switch can be used for regex but it doesn't support ends_with, if condition supports but how to use regex in if condition? If yes how do i do it?