This should work:
The find line: ^(.*?\/p).*\/?(\/.*)$ The replace line: $1$2
^(.*?\/p).*\/?(\/.*)$
$1$2
The example assumes you have the URL in a variable, but you could easily change it to work off clipboard, etc.
-rob.
For more information, see the wiki Searching the Forum for Answers section.