I am struggling with regExp.
I just want to parse incoming urls to my application.
Here is my current RegExp :
var regexp = new RegExp('/users','i');
"/users".test(regexp); //Should return true
"/users/".test(regexp); //should return true
"/users?variable1=xxx&variable2=yyy&variableN=zzzz".test(regexp); //Should return true
"/users/?variable1=xxx&variable2=yyy&variableN=zzzz".test(regexp); //should return true;
"/users?variable1=xxx&variable2=yyy&variableN=zzzz/10".test(regexp); //Should return false
"/users/?variable1=xxx&variable2=yyy&variableN=zzzz/10".test(regexp); //should return false;
"/users/10".test(regexp); //should return false
"/users/10/contracts".test(regexp); //Should return false
"/users/10/contracts/10".test(regexp); //Should return false
"/users/anythingElseThatIsNotAQuestionMark".test(regexp); //Should return false
Is anyone has the kindness to help me ?
Wish you a nice evening.