Regular Expressions For Cleaning Up URL Lists - Mostly Find/Replace for text editors
Find: ^(?:.(?<!pattern))*$
Replace:
Find: (.*?)([^/]+(?=/$|$))
Replace: $2
Find: ([^?]+).*
Replace: $1
Find: (.*?)(?<!\.php)\n
Replace:
Remove everything that doesn't contain .php