\"43STX4P-2-2-C1::TRCCMP=DISABLED,J0_EX=\"\",J0_FMT=16,J0_INC=\"??????????????
?\",J0_STAT=UNSPECIFIED,MAPPINGMODE=ASYNC,CHANNEL=NONE,MODULETYPE=XS-64.2B,AINST
MR=00-10,AINSCNTDWN=00-00,LOSPROP=LASERON,AINSREF=SYSTEM,RXPOWER=-99.00,TXPOWER=
0.69,DESCR=\"\":OOS-AUMA,FAF&MT\"
"43STX4P-2-2-C2::TRCCMP=DISABLED,J0_EX=\"\",J0_FMT=16,J0_INC=\"??????????????
?\",J0_STAT=UNSPECIFIED,MAPPINGMODE=ASYNC,CHANNEL=1550,MODULETYPE=XS-64.2B,AINST
MR=00-10,AINSCNTDWN=00-00,LOSPROP=LASERON,AINSREF=SYSTEM,RXPOWER=-99.00,TXPOWER=
-99.00,DESCR=\"\":OOS-AUMA,FAF"
\"43STX4P-2-2-C3::TRCCMP=DISABLED,J0_EX=\"\",J0_FMT=16,J0_INC=\"??????????????
?\",J0_STAT=UNSPECIFIED,MAPPINGMODE=ASYNC,CHANNEL=1550,MODULETYPE=XS-64.2B,AINST
MR=00-10,AINSCNTDWN=00-00,LOSPROP=LASERON,AINSREF=SYSTEM,RXPOWER=-99.00,TXPOWER=
-99.00,DESCR=\"\":OOS-AUMA,FAF"
"43STX4P-2-2-C4::TRCCMP=DISABLED,J0_EX=\"\",J0_FMT=16,J0_INC=\"??????????????
?\",J0_STAT=UNSPECIFIED,MAPPINGMODE=ASYNC,CHANNEL=1550,MODULETYPE=XS-64.2B,AINST
MR=00-10,AINSCNTDWN=00-00,LOSPROP=LASERON,AINSREF=SYSTEM,RXPOWER=-99.00,TXPOWER=
-99.00,DESCR=\"\":OOS-AUMA,FAF"
"43STX4P-4-2-C1::TRCCMP=DISABLED,J0_EX=\"\",J0_FMT=16,J0_INC=\"??????????????
?\",J0_STAT=UNSPECIFIED,MAPPINGMODE=ASYNC,CHANNEL=1550,MODULETYPE=XS-64.2B,AINST
MR=00-10,AINSCNTDWN=00-00,LOSPROP=LASERON,AINSREF=SYSTEM,RXPOWER=-99.00,TXPOWER=
-99.00,DESCR=\"\":OOS-AUMA,FAF"
"43STX4P-4-2-C2::TRCCMP=DISABLED,J0_EX=\"\",J0_FMT=16,J0_INC=\"??????????????
?\",J0_STAT=UNSPECIFIED,MAPPINGMODE=ASYNC,CHANNEL=1550,MODULETYPE=XS-64.2B,AINST
MR=00-10,AINSCNTDWN=00-00,LOSPROP=LASERON,AINSREF=SYSTEM,RXPOWER=-99.00,TXPOWER=
-99.00,DESCR=\"\":OOS-AUMA,FAF"
"43STX4P-4-2-C3::TRCCMP=DISABLED,J0_EX=\"\",J0_FMT=16,J0_INC=\"??????????????
?\",J0_STAT=UNSPECIFIED,MAPPINGMODE=ASYNC,CHANNEL=1550,MODULETYPE=XS-64.2B,AINST
MR=00-10,AINSCNTDWN=00-00,LOSPROP=LASERON,AINSREF=SYSTEM,RXPOWER=-99.00,TXPOWER=
-99.00,DESCR=\"\":OOS-AUMA,FAF"
"43STX4P-4-2-C4::TRCCMP=DISABLED,J0_EX=\"\",J0_FMT=16,J0_INC=\"??????????????
?\",J0_STAT=UNSPECIFIED,MAPPINGMODE=ASYNC,CHANNEL=1550,MODULETYPE=XS-64.2B,AINST
MR=00-10,AINSCNTDWN=00-00,LOSPROP=LASERON,AINSREF=SYSTEM,RXPOWER=-99.00,TXPOWER=
-99.00,DESCR=\"\":OOS-AUMA,FAF"
/* RTRV-STM64 */
请帮我基本解析这个字符串我需要的是这部分 43STX4P-4-2-C4 我想提取像 43STX4P-4-2-C1 43STX4P-4-2-C2 43STX4P-4-2-C3 这样的字符串稍后在命令中的变量中使用请帮助我我尝试了一切
编辑 r00t 解决方案效果很好,但字符串中可能并不总是 43STX4P 它可能看起来像 130SCX10- 43SCX4L- 43SCX4-
另一个注意事项是 43STX4P-2-2-C3 .. -2-2 中的数字可能并不总是单个数字
编辑
这是我在网上研究和一些运气后得到的
set ports [regexp -inline -all {\w*-.-[0-9]+-C[0-9]+} $rawoutput]
告诉我我的代码是否有任何缺陷非常感谢您的帮助!