How to grab the IP address from a variable through an Event Procedure and Regular Expression?
Release : 10.4.1
Component : Spectrum Alarm & Event Management
Use the following URL to validate your REGEX:
((?:\d+\.){3}\d+)
Here is an example:
The Event Procedure on 0x210d40 event code will generate the 0xfff0000b event code with the existing variable and it will grab the IP Address from the variable {S 4} and put it in the variable {S 6}.
0x210d40 E 0 P "CreateEventWithVariables({C CURRENT_MODEL}, {H 0xfff0000e}, SetEventVariable(GetEventVariableList(), {U 6}, GetRegexp(GetEventVariable({U 4}), {S \"((?:\\\\d+\\\\.){3}\\\\d+)\"}, {U 1})))"
0xfff0000e E 0
Please review this section of Spectrum guide about using Escape Character in the Event Procedure: