【发布时间】:2013-12-08 17:17:24
【问题描述】:
我的源代码文件中有以下类型的文本:
html += T.m('current value of the quality level of the security service (as established from the diagnostic phase).');
or
{header: T.m("Service to Improve"), dataIndex : 'searvicesToImprove', hideable: false},
or
Ext.getCmp('MAX_ACTION_PLANS_PAGE').setText(T.m('od') + ' ' + MAX_ACTION_PLANS_PAGE);
我想提取括号内的子字符串,即。从 T.m(X) 我想得到不带引号或带引号的 X,然后我会修剪它们。
所以换句话说,我想要这样的东西
regex( "T.m('X')" | "T.m("X")" );
and then say:
listOfMatches.add(X);
我知道这通常是用 regexp 完成的,但我对 regexp 不是很好,没有使用太多,仅用于基本示例。 非常感谢任何帮助。
【问题讨论】:
标签: c# regex string substring extraction