regex - Regular Expression Reverse Matching - Url with some special characters not in it -
So I am trying to find a solution to this problem for the last 3 hours. Finally, posting it on stack overflow, I can not find any solution. The problem is that I have a URL of the form
/ myurlbase / firstname-lastname-nameId < / code> The first name is a string that is the last name string and it is optional (hence url / myurlbase / firstname-nameId) nameID is a number
I Match only the regular URL where the first name and the last name want The expression has to match. Please do not reply with an answer that matches in another way and do not keep in front.
You can use this rewrite rule:
RewriteRule ^ Myurlbase / ([az] +) - (?: ([Az] +) -)? ([0- 9] +) /? $ / target? fn = $ 1 & amp; ln = $ 2 & amp; Id = $ 3 [L, NC]
Comments
Post a Comment