ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > Living Room

Regexp help

(1/3) > >>

Alright, I am trying to create a regexp that performs the following:

Selects an IP address from a line but only if the line starts with a pre-defined text string. There will be text in between the text string and the IP address -- I want to ignore the entire line except for the IP address. I know this is do-able but it is driving me nuts.

Any ideas?


Or perhaps:


But, that should do it or at least give you enough to test & tweak. You'll have 1 capture group with the IP address.

This is better:


So...Here is a single line of what I am trying to filter:

SOME DATE TIME GROUP HERE :: CtrlChan Some more text here []

I want to filter out the IP address in any line that contains CtrlChan.

Sample line

2014-10-10 19:28:01.110::ErrorMsg::CtrlChan Error_Decode []

If, and only if, the line has CtrlChan in it do I want to extract the IP address from the line. This will be a very large file (200+MB per file) with a large number of different entries.


[0] Message Index

[#] Next page

Go to full version