So i have this url "https://www.site.be/pand/titel-van-het-pand-t8500-17082-4" and i have to extract the reference number at the back of the url. In this example "t8500-17082-4" with GTM to put into a custom dimension like this:
var dimensionValue = 'REFERENCE_CODE_HERE';
ga('set', 'dimension1', dimensionValue);
The reference codes at the eind of the url could start with either -t8... or t9...