Extract string found in line

2014-05-11 Thread Lee Hinde
I am parsing apache log files. This is the grep pattern I'm using:

GET /public/search/\?q=(\w|\+|\.|-)+

works fine. But I want to extract just the text that matches that string
and lose all the rest of the line.

How would I do that?

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 

--- 
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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.


Re: Extract string found in line

2014-05-11 Thread Christopher Stone
On May 11, 2014, at 14:36, Lee Hinde  wrote:
> I am parsing apache log files. This is the grep pattern I'm using:
> 
> GET /public/search/\?q=(\w|\+|\.|-)+
__

Hey Lee,

When making these kinds of requests it's always better if you provide an actual 
sample of the data you're working with.

Just looking at it I could say:

Find:

.*(GET /public/search/\?q=(\w|\+|\.|-)+).*

Replace:

\1

But I'd much rather see the data and actually test my solution.

For that matter this seems like a job for a Perl filter.

--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 

--- 
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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.