Need a little GREP help

31 views
Skip to first unread message

Michael Heth

unread,
Oct 4, 2022, 8:28:37 AM10/4/22
to BBEdit Talk
Say Folks,

Have been trying to get my head around GREP for many years and never quite get it.

I've asked for help before and folks were able to give me the cryptic code to get my little task in the done column.

So, I have a list with over 450 lines like these

1995 DUCATI M600 Monster
1995 DUCATI M900 Monster
1995 DUCATI Superbike 748 Biposto / SP
1995 DUCATI Superbike 916 Biposto / Senna

and I need them to end up like this

<option value="1995 DUCATI M600 Monster" >1995 DUCATI M600 Monster</option>
<option value="1995 DUCATI M900 Monster" >1995 DUCATI M900 Monster</option>
<option value="1995 DUCATI Superbike 748 Biposto / SP" >1995 DUCATI Superbike 748 Biposto / SP</option>
<option value="1995 DUCATI Superbike 916 Biposto / Senna" >1995 DUCATI Superbike 916 Biposto / Senna</option>

Any tips.help is much appreciated.

Thanks,

M./

Kaveh

unread,
Oct 4, 2022, 8:39:02 AM10/4/22
to bbe...@googlegroups.com
Search:
(.+)
Replace:
<option value="\1" >\1</option>

--
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/2d19291b-ac2f-41f4-9517-ee5cad8d2505n%40googlegroups.com.


--
Kaveh Bazargan PhD
Director
Accelerating the Communication of Research

eu...@gmx.de

unread,
Oct 4, 2022, 8:51:53 AM10/4/22
to bbe...@googlegroups.com
Search Pattern:  ^.*$

Replace Pattern: <option value="\0" >\0</option>

Will do the job!



Michael Heth

unread,
Oct 4, 2022, 8:51:56 AM10/4/22
to bbe...@googlegroups.com


> On Oct 4, 2022, at 5:37 AM, Kaveh <ka...@rivervalleytechnologies.com> wrote:
>
> Search:
> (.+)
> Replace:
> <option value="\1" >\1</option>

Thanks much, worked like a champ.

I’ll have to try and wade through the docs on GREP again and see if it catches this time.

Or, Or,

The folks at BB could do a 5 minute YT video showing various examples of common tasks and then billions of BBEdit users would all get a leg up.

Just sayin’

Thanks again.

M.

Kaveh

unread,
Oct 4, 2022, 8:58:10 AM10/4/22
to bbe...@googlegroups.com
Hi Michael

Glad it worked. It's actually very easy once you get the knack. I have been meaning to do some video tutorials so thanks for the prompt. Feel free to remind me again. No problem if you want to email privately. 

Regards
Kaveh

--
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.
Reply all
Reply to author
Forward
0 new messages