Is there a regex, which will read and return the ip address in proper format in this text? Note it's backward, so the regex would have to step through the code backwards then replace '|' with '.'
It's been driving me crazy... and I'd appreciate your help ;)
Excerpt From Code:
4.3/d/c/b.a",10:"0://8.7/1/1.f",z:"0://8.7/1/y.x",w:"0://6.5.4.3/i/v/u.t",s:"r",q:p,o:n,9:\'0\',m:[{2:"l",k:"0://8.7/1/1.f"},{2:"j",h:{e:\'0://6.5.4.3/d/c/b.a\',\'9\':\'0\'}},{2:"g"}]});',36,40,'|type|187|20|207|31|com|hystorystingbulk|
Desired Return:
31.207.20.187
Thanks!
Edit: I have bits and pieces, but I can't put it together to get me the desired outcome
(?<=/|^) -- a positive lookbehind
\b\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\b -- this will get you the ip in a given file/text
\b\d{1,3}\|\d{1,3}\|\d{1,3}\|\d{1,3}\b --this returns the ip (but backwards. remember I wanted it flipped) and separated by '|' instead of '.'
Someone asked....I'm using Python and testing using http://www.regexplanet.com/advanced/python/index.html THX