次のように正規表現の検索と置換が必要です。
images
入力文字列は,videos
で終わりますfriends
- 出力文字列には、一致した接尾辞が含まれています
- そうしないと
- 出力文字列には接尾辞が含まれます
profile
- 出力文字列には接尾辞が含まれます
入力/出力の例:
/john-smith-images
->/user-images
/john-smith-videos
->/user-videos
/john-smith
->/user-profile
存在する場合、サフィックスをキャプチャするこの正規表現を試しました:
/.+?(images|videos|friends)?$/
私は1 つの正規表現と正規表現のみのソリューションに制限されています。これを mod_rewrite/IIRF/IIS URL 書き換えで使用する必要があります。