Match Optional Components in Any Order
问题 I have a URL that can contain any combination of parameters used in filtering results. The two params are type and sort. If type exists in the URL, it has to be either 'article', 'opinion', 'review', or 'media. If sort exists in the URL, it has to be one of the following: date-desc, date-asc, views-desc, views-asc, comments-desc, comments-asc. Right now, the expression I have only matches URI's with both type and sort. And it doesn't match URL's that contain neither params. I would like the