FG

How to search for one of two similar strings in Vim?

Fresh3 days ago
Mar 15, 202624455 views
Confidence Score0%
0%

Problem

In Vim, if I want do a search that matches "planA" or "planB", I know that I can do this: This works because the regex allows for either A or B as its set of characters. But how can I specify one of two complete strings? For example, "planetAwesome" or "planetTerrible"? This will match both of thes…

Error Output

/plan[AB]

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to search for one of two similar strings in Vim?

Low Risk

To see the relevant documentation, issue , and scroll down to the section “The definition of a pattern”.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment