如何使用 OR 比较 Google 工作表中的几个 RIGHT 函数来缩短公式?

How to shorten a formula with a OR comparing several RIGHT functions in Google Sheets?

我正在尝试解决这个问题:

我需要缩短以下公式:

=IFS(
OR(
RIGHT(A1,1)="^",
RIGHT(A1,1)="*",
RIGHT(A1,2)="@@",
RIGHT(A1,2)="%%"),
1,TRUE,0)

我想像这样使用管道符号:

=IFS(
OR(
RIGHT(A1,1)="^|*",
RIGHT(A1,2)="@@|%%"),
1,TRUE,0)

但是没用。

如何缩短这个公式?

| 只能在正则表达式中使用。这个怎么样:

=N(REGEXMATCH(A1, "\^$|\*$|@@$|%%$"))