1

Hi trying out latest BBedit on Ventura Apple silicon.

Have been wrapping my head around the (im)possibility to search for different strings at once in the find window, in order to have each occurrence replaced by one single term.

I would like something like this :

Find : string 1 OR string 2 OR string 3

Replace : string 4.

In the manual it seems this should be possible with the straight bar | but that didn't find anything at all.

I'm sure this must be possible but am unable to find out how.

2 Answers 2

0

You're right that the pipe symbol acts as OR.
e.g. string1|string2|string3
It's a common usage, but BBEdit doesn't use it until you switch on 'grep'

Off…
enter image description here

On…
enter image description here

Once enabled, then Replace will work as you expected.

enter image description here

using random rtf file with my 'what to watch on TV' list ;))

4
  • 1
    ok so that's the culprit !!! I had tried exactly that syntax without having Grep checked... Thanks a lot for the quick reply (sparing me hours of work) ! As a follow-up question : is it possible to have a given set of different entries with different answers in the Find field or is it one category by one. I mean : if string 1 or 2 or 3 then replace by string 4 if string A or B or C then replace by string D could this be done in a single step or must i do different search&replace operations to be able to achieve that ? Commented Apr 15, 2023 at 9:44
  • Excellent! Remember to check the grey checkmark ✔ left of this answer to turn it green [it might make you wait some time, as a new user]. That way future googlers will be better able to find it.
    – Tetsujin
    Commented Apr 15, 2023 at 9:47
  • You should ask that as a separate question - it would need to support an ELSE logic. I'm not sure it does.
    – Tetsujin
    Commented Apr 15, 2023 at 9:48
  • ok will do thanks ! Commented Apr 15, 2023 at 9:50
0

BBedit supports PCRE regular expressions.

Your search expression will look like :

string1|string2|string3

Reference : PCRE Regex Cheatsheet.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .