Howto to compare this string :
commodity/search/oil/branch/index
with this :
commodity/search/*/branch/index
It should return true although “oil” is replace with other word.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
$matchwill be true (or some value evaluating to true, like 1) if a match is found.Note: the above will match on any extra path, such as
commodity/search/some/other/word/branch/indexIf you just want to match a single word, but not something resembling a path structure, then you might try something like this:
This will only match against upper and lower case a-z characters, numbers, hyphens and underscores. Adjust as needed.