特定文本 Google 工作表之前的正则表达式提取数字

Regexextract number just before specific text Google sheets

我需要提取文本前的数字 Positions

示例字符串:

Medical Specialist (Anaestheologist) (4 Positions) at Ministry

有效输出应为 4

示例字符串 2(如果文本位置不存在)

Medical Specialist (Anaestheologist) (4) at Ministry

有效输出

4

我试过了:

=REGEXEXTRACT(A24,"\(.*Positions.*\)") 但是没用。

尝试:

=ARRAYFORMULA(REGEXEXTRACT(A1:A2; "(\d+)(?: Positions)?"))