This patch allows use of negative offsets for the SUBSTR directive, useful for TABLE:plain messages.
For example, for the linux-wrt template's disk, one could use the following in transforms:
DiskSizeSpaces : REGSUB : {DiskSize} /(.*)/ $1/
DiskSizeSpace : SUBSTR : {DiskSizeSpaces} -8
Then use {DiskSizeSpace} instead of {DiskSize} for a right-aligned value in an 8 space-filled field.
Patch for dm_template.pm and dm_tests.pm
Due to the conversion of the Details to HTML, it isn't obvious that the REGSUB line has numerous spaces between "/(.*)/" and "$1/".
I think the example you gave above isn't complete, I get 'No data'. for {DiskSizeSpace}
Also ... what is the motivation for this? Just cleaning up the (e.g.) disk output to look more regular (like df or df -P)?
On most of my systems, df -P isn't correctly aligned anyway (as I'm mostly using lvm everywhere), and on some, 8 characters isn't enough.