/user/(?P<user>[^/]+)/(?P<action>[^/]+)
Just to explain a couple problems with your original regex:
[.*]+
means a positive number of occurrences of a dot and an asterisk only, example:*.*.*
or.
or......
;[^/]+
describes a positive number of any characters but slashes.- No need to escape slashes, as they're not special characters when you're using
~
as delimiters. - Your regex also required /app at the beginning, which wasn't present in your string.