你可以使用正则表达式来提取括号中的值。下面是一个使用正则表达式的示例代码:

const str = '(垂体肿瘤)垂体腺瘤。 免疫组化结果:GH(+),PIT-1(+),LH(+),ACTH(-),PRL(-),TSH(-),FSH(-),T-PIT(-),Ki-67(index1%),P53(-),CAM5.2(纤维小体+),ER(-),SSTR2(3+),MSH-6(+),MGMT(+),CgA(+)。';

const regex = /Ki-67\(([^)]+)\)/;
const match = str.match(regex);

if (match) {
  const value = match[1];
  console.log(value);
} else {
  console.log("未找到匹配的值");
}

运行以上代码,你将获得输出:index1%


原文地址: https://www.cveoy.top/t/topic/hzfG 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录