how to use Regular Expressions (regex) inside NX Expressions?
how to use Regular Expressions (regex) inside NX Expressions?
(OP)
NX8.0.1 MP1
I have a situation in which I have an NX expression which evaluates to a string, such as the following filename:
partname = "123456.2.10.prt"
My goal is to create another string from this one, pulling out portions of the original string.
For example:
partrevision = "2.10"
or:
partnumber = "123456"
Can anyone advise on how to accomplish this? I think Regular Expressions (regex) would be a good way to do this if possible to implement within the NX Expressions Editor, but I haven't done this before and can't seem to find any useful advice in the NX Documentation.
Thanks in advance.
I have a situation in which I have an NX expression which evaluates to a string, such as the following filename:
partname = "123456.2.10.prt"
My goal is to create another string from this one, pulling out portions of the original string.
For example:
partrevision = "2.10"
or:
partnumber = "123456"
Can anyone advise on how to accomplish this? I think Regular Expressions (regex) would be a good way to do this if possible to implement within the NX Expressions Editor, but I haven't done this before and can't seem to find any useful advice in the NX Documentation.
Thanks in advance.





RE: how to use Regular Expressions (regex) inside NX Expressions?
You will now see a list of 'string' functions which includes functions to extract sub-strings. To see how to use a certain function, just select it from the list and then select the icon labeled '?' near the bottom of the list box at the right.
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum: http://www.plmworld.org/p/cm/ld/fid=209
To an Engineer, the glass is twice as big as it needs to be.