Do a search for:

^.*(c=[0-9.]+)$

^ anchor pattern to beginning of line
.* any number of any character
() capture buffer — copy anything inside the brackets to ‘\1'
[0-9.] look for any of these characters
+ 1 or more times
$ end of line

and replace the entire match (i.e. line) with the capture buffer:

\1

You could make the IP match more exact, but I don’t think the complexity is 
warranted.

Cheers


> On 2022-07-27, at 12:55, DiBello Design <[email protected]> wrote:
> 
> greetings.   Newbe trying to extract ip addresses from a log file.
> 
> Ip addresses are all different.  They are at the end of each line with a c= 
> preface.  like c=38.133.119.165
> 
> the actual lines look like this:
> 
> [Tue Jul 26 19:09:37.658083 2022] [qos:error] [pid 1197:tid 47464083257088] 
> mod_qos(034): access denied, QS_SrvMinDataRate rule (in:0): min=246, this 
> connection=0, c=70.160.126.199
> [Tue Jul 26 19:09:37.711177 2022] [qos:error] [pid 1330:tid 47464083257088] 
> mod_qos(034): access denied, QS_SrvMinDataRate rule (in:0): min=246, this 
> connection=0, c=38.133.119.165
> 
> how do I remove everything from the line except c=xx.xx.xx.xx ?

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/457BF9DC-6192-4BA2-A954-8F306EF32DD5%40gmail.com.

Reply via email to