John,
Though your pattern solve the string piece here, I think it's not an exact solution.
TiaanB wants "trim off everything from the third underscore(_) to the end"
But your pattern just reserve all words before _ and a digit..
If the first digit appear at other position, it will fail.
Even in your way, I think just replace all _\d.+?$ or (_\d+)+ to empty is more simple and faster.
But I think using _\d as splitter is not reliable.
The key ishe third underscore(_)
If you don't improve your pattern, I think the answer of this thread would be gained by Xalnix, :)
www.wonderstudio.cn