Using jQuery, simply:
$("[id='block-id-45']").attr("id").split("-")[2]
For all block-id-##, you can use mask pattern from Peter's answer:
$("[id^='block-id-']").click(function(){
row_id = $(this).attr("id").split("-")[2];
.............
.............
})