The regex is performed on the filename, not the full path, so that approach won't work.
You can use {parent1}, {parent2}, etc. to insert the names of parent folders into the new name. So you could do that and then a second rename. Or you could use a rename script which lets you do pretty much anything, all in one go, including apply a regex to the full path: Script to perform multiple Regular Expressions