no, unfortunately it is not that easy. i am actually using this within formulas. i have a formula like
length * width
i use the regexes to replace the variablenames in there with the correct values like
3 * 2
and then use some code i found in the speedcrunch-code to calculate a result.
now unfortunately sometimes something does not only have its own attributes but needs to use the attributes of some connected assets. Think for example of a sewage water system where you have pipes and manholes. now you have 3 assets: 2 manholes and one pipe. If you want to know the volume of earth that you need to remove before building the pipe you have to calculate:
length * (manhole1.depth * manhole2.depth)/2
So this is why there are dots in there
therefore i will not always have a blank around the word i am searching for, there might also be brackets or other stuff. So i could possibly search for
([().+/*-])(name)
but i would have to check this everytime i allow a different mathematical expression. It would be more elegant if there was something like [\b^.]
Bookmarks