D. Tunus
D. Tunus

Reputation: 271

How can I convert '+' character to a regular expression for REGEXMATCH in Google Sheets?

=IF(OR(REGEXMATCH(C3,"A"),REGEXMATCH(C3,"+"),REGEXMATCH(C3,"G")),1,0)

In Google Sheets, I'm using the above formula to output 1 if either A, + or G characters are present in cell C3. Some example values for C3 are AG+, ABCDKHN$%, GHXV, etc, those will lead the formula to output 1.

The + character ends up with this error:

description

How can I convert the + character for the REGEXMATCH formula to look for it in a string successfully?

Upvotes: 2

Views: 77

Answers (1)

player0
player0

Reputation: 1

try just:

=IF(REGEXMATCH(C3, "A|G|\+"), 1, 0)

Upvotes: 2

Related Questions