Regexp help in getting the IP address
"Sarika Inamdar " <[email protected]> Fri, 6 Jun 2003 15:13:13 +0530
| Newsgroups | gmane.comp.jakarta.regexp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi All, We have to get the IP address from the following xml event : Threshold123(10.77.11.92)2003-06-05T06:20:00.171Z<name>cdfjdp01</name><i pa ddress>10.77.11.48</ipaddress><entity>Cisco CNS-PerfE</entity><version>dev</version><time>2003-06-05T06:20:00.172Z</ time>criticalcleared.1.3.6.1.2.1.2.2.1.10.31885616724LTE2000000000com.ci sco.das.MibCollector.MibCollector In general, we should be able to get any CLASS A/B/C Ip address ( 1.1.1.1/22.1.1.1/172.29.102.9) But the issue is, the start of the string contains "threshold<digits>" followed by<ipaddress> ? How I differentiate between the ip address and the digits ? Any regexp which can achieve the same ? Please let us know on this. Thanks much in Advance, Saika