如果我知道字符串的开始和字符串的结尾(在大字符串中出现很多次),那么在两个字符串之间获取内容并添加内容的最佳方法是什么这个内容到一个字符串列表?正则表达式将字符串添加到列表中
RegEx是最好的方法吗?如果是这样,我可以请一些示例代码来处理?
编辑
我使用Visual Basic.net这个问题是关于通过打开.vbproj文件和获取信息获取的项目中的文件。
下面是一个例子:
<Compile Include="CommonActions.vb" />
<Compile Include="Controller.vb" />
<Compile Include="formAbout.designer.vb">
<DependentUpon>formAbout.vb</DependentUpon>
</Compile>
<Compile Include="formAbout.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormKey.designer.vb">
<DependentUpon>FormKey.vb</DependentUpon>
</Compile>
<Compile Include="FormKey.vb">
<SubType>Form</SubType>
</Compile>
我希望得到的.vb文件的列表。在上面的例子,该列表将包含以下内容:
CommonActions.vb,Controller.vb,formAbout.designer.vb,formAbout.vb,FormKey.designer.vb,FormKey.vb
我可知道什么是输入,什么是您的要求输出。举一些例子。当然,我们可以用正则表达式来完成,但是它会根据需要进行更改。 – Civa 2013-04-27 05:18:59