I am trying to modify the displayed name of an element in a visual overview from 'ABC-XYZ' to 'ABC'. The element name is retrieved using the INFO shape data filed and I apply a RegexReplace but this doesnt seem to be working. Any ideas if this is a syntax issue or its currently not supported ?
INFO | [RegexReplace:-*,[ELEMENT NAME],]
INFO | [RegexReplace:(-)*,[ELEMENT NAME],]
Thanks Aston. I believe you are right, the [ELEMENT NAME] placeholder doesnt resolve. I thought it was implied in the help pages although not specifically documented. Also putting the name directly doesnt work. My use-case unfortunatley will not allow me to manupulate from a protocol.
Hi Wale,
With the Info shape data I am not sure if it is possible but adding the expression to the shape text should do what you need.
Additionally, the current regex expressions you are using may result in a slightly different result than the one you are after as you can see below.
The * character in regex behaves like a quantifier which means it will try to find 0 or more occurrences of the - character
Adapting slightly your expression to -.* means that it will look for the - followed by 0 or more occurrences of . (which in the context of regex is a wildcard for any character)
The shapes in Visio
The shapes in DataMiner
The final expression you need to use is
[RegexReplace:-.*,[this element],]Spot on! Joao Thanks. I actually didnt know that manupulating shape text was possible in this manner.
Hi Wale,
As far as I’m aware the Info (Shape Data) does not handle Placeholders. The second issue I see is that there isn’t [ELEMENT NAME] placeholder documented, so the RegexReplace query would not resolve. I have yet to find a way to display the result from a RegexReplace directly. So my only idea would be to have a parameter in your protocol where you could manipulate the element name via a QAction and display it.