Further to arnold's post here is some javascript that will do it for you. The pattern is slightly different it does a non-greedy match of everything after the second '/' to the third '/'
<script>
var pattern = /\/cms\/getfile\/(.*?)\//;
$(function() {
$('#pattern').html(pattern);
$('button').click(function() {
var input = $('#url').val();
var result = input.match(pattern);
$('#resultbox').html(result[1]);
});
});
</script>
Open in new window
Working sample here