I am having hard time learning regex and honestly I have no time at the moment. I am looking for a regex expression that would match url route with query string
What I need is regex to match population?filter=nation of course where nation can be any string.
Based on my current regex knowledge I have also tried with regex expression /^population\/(?P<filterval>\d+)\/filter$/ to match population/nation/filter but this does not work.
Any suggestion and help is welcome.
^\/?population(?:\/|\?filter=)(?P<filterval>[^\/]+)(?:\/filter\/?)?$(see demo)?nationvalues contain characters like-? Like in "Great-Britain" or "New-Zealand" just for the sake of being there. Not being gramatically correct and is this the complete querystring or does something else follow? (filter=nation&foo=bar) ?