Need to extract the last word from a device interface description below in my Cisco NSO XML template.
ncs(config)# xpath eval /oc-if-config:oc-interfaces//device[device='se1']/interfaces/interface[name='1/1/c1/1']/config/description
/oc-if-config:oc-interfaces//device[device='se1']/interfaces/interface[name='1/1/c1/1']/config/description :: to sx1
ncs(config)#
Line I'd like to construct in my XML template (replacing substring-after-last with a supported function):
<?set LAST_WORD={substring-after-last(config/description, ' ')} ?>
For the above description string "to sx1" I need it to extract "sx1". This last word could be of any length, and there could be any number of space-delimited words in the description.
Does a Cisco NSO template support a regular expression or similar function to achieve this?