Help for search & replace with Grep

44 views
Skip to first unread message

mrcmrc

unread,
Jun 12, 2020, 8:04:11 AM6/12/20
to BBEdit Talk
Hi,
someone may help me? Usually I can do some very simple replacements, but I don't have great experience with Grep syntax...

I have a block of text like this:

Miles Davis – trumpet
John Coltrane – tenor saxophone
Red Garland – piano
Paul Chambers – double bass
Philly Joe Jones – drumset

and wish to get this:

Miles Davis, John Coltrane, Red Garland, Paul Chambers, Philly Joe Jones

Thanks for any help!


Jean-Christophe Helary

unread,
Jun 12, 2020, 9:39:42 AM6/12/20
to bbe...@googlegroups.com
Search:

– .*\n

Replace:

,

there is a space at the beginning of the search string
and one at the end of the replace one.


--
Jean-Christophe Helary @brandelune
http://mac4translators.blogspot.com

mrcmrc

unread,
Jun 12, 2020, 10:19:03 AM6/12/20
to BBEdit Talk
Thanks Jean-Christophe! It worked!

- Marco.

Jean-Christophe Helary

unread,
Jun 12, 2020, 10:37:20 AM6/12/20
to bbe...@googlegroups.com


> On Jun 12, 2020, at 23:18, mrcmrc <mrc...@gmail.com> wrote:
>
> Thanks Jean-Christophe! It worked!

Take the time to look at the manual. It is extremely well written.

In fact, I had the exact same questions back in 96 when I first used BBedit, and I decided to read the manual and everything I know about regular expressions now pretty much comes from it.

So just take one or two hours to check it. Play with the search function and see what you can do by yourself.

Fletcher Sandbeck

unread,
Jun 12, 2020, 10:40:25 AM6/12/20
to bbe...@googlegroups.com
Also, check out the Pattern Playground on the Search menu. Being able to see what BBEdit is matching as you change the search pattern really helps narrow in on how to make it work for your actual data.

[fletcher]
> --
> This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" 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 bbedit+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/825618E2-89F9-4031-9198-2BB71EED10A0%40traduction-libre.org.

mrcmrc

unread,
Jun 12, 2020, 2:37:45 PM6/12/20
to BBEdit Talk
I'll do for sure!

- Marco.

mrcmrc

unread,
Jun 12, 2020, 2:37:48 PM6/12/20
to BBEdit Talk
Thanks Fletcher, I'll take a look.

- Marco.


On Friday, June 12, 2020 at 4:40:25 PM UTC+2, flet...@cumuli.com wrote:
Also, check out the Pattern Playground on the Search menu. Being able to see what BBEdit is matching as you change the search pattern really helps narrow in on how to make it work for your actual data.

[fletcher]


> On Jun 12, 2020, at 7:37 AM, Jean-Christophe Helary <jean.chris...@traduction-libre.org> wrote:
>
>
>
>> On Jun 12, 2020, at 23:18, mrcmrc <mrc...@gmail.com> wrote:
>>
>> Thanks Jean-Christophe! It worked!
>
> Take the time to look at the manual. It is extremely well written.
>
> In fact, I had the exact same questions back in 96 when I first used BBedit, and I decided to read the manual and everything I know about regular expressions now pretty much comes from it.
>
> So just take one or two hours to check it. Play with the search function and see what you can do by yourself.
>
>
> --
> Jean-Christophe Helary @brandelune
> http://mac4translators.blogspot.com
>
> --
> This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" 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 bbe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages