I have an event variable that contains a number of characters. However, I am only interested in what is contained within a set of parenthesis (). How can I extract the information within parenthesis () from an event variable in Spectrum?
Release: Any version of Spectrum
Component:
This can be done using a Event Procedure. The following is an example:
0xfff00003 E 20 P "CreateEventWithAttributes( { C CURRENT_MODEL },{H 0xfff00004 },SetEventAttribute(GetEventAttributeList(),{ U 101 },GetRegexp(GetEventAttribute({ U 1 }),{ S \"[(]([^)]+)\"} ,{ U 1 })))"
For the above Event Procedure, when the 0xfff00003 event is generated:
The following is an example of the contents of the 0xfff00003 and 0xfff00004 events showing the values of Event Variables 1 and 101:
Jun 2, 2016 11:32:34 AM EDT | Sim15090:Lab-A1 |
Event Variable 1: I just want what is inside of the parenthesis (This is what I want) nothing else. This is what I want |
System | 0xfff00004 | ||
Jun 2, 2016 11:32:34 AM EDT | Sim15090:Lab-A1 |
Event Variable 1 I just want what is inside of the parenthesis (This is what I want) nothing else. |
System | 0xfff00003 |