Task to filter an Input list with a Regex expression. Output list contains items from Input list that matched given expression
Namespace: MSBuild.Community.Tasks
Assembly: MSBuild.Community.Tasks (in MSBuild.Community.Tasks.dll)
Syntax
Example
Matches from TestGroup those names ending in a, b or c
Copy Code | |
---|---|
<ItemGroup> <TestGroup Include="foo.my.foo.foo.test.o" /> <TestGroup Include="foo.my.faa.foo.test.a" /> <TestGroup Include="foo.my.fbb.foo.test.b" /> <TestGroup Include="foo.my.fcc.foo.test.c" /> <TestGroup Include="foo.my.fdd.foo.test.d" /> <TestGroup Include="foo.my.fee.foo.test.e" /> <TestGroup Include="foo.my.fff.foo.test.f" /> </ItemGroup> <Target Name="Test"> <!-- Outputs only items that end with a, b or c --> <RegexMatch Input="@(TestGroup)" Expression="[a-c]$"> <Output ItemName ="MatchReturn" TaskParameter="Output" /> </RegexMatch> <Message Text="
Output Match:
@(MatchReturn, '
')" /> </Target> |
Inheritance Hierarchy
System.Object
Microsoft.Build.Utilities.Task
MSBuild.Community.Tasks.RegexBase
MSBuild.Community.Tasks.RegexMatch
Microsoft.Build.Utilities.Task
MSBuild.Community.Tasks.RegexBase
MSBuild.Community.Tasks.RegexMatch
Thread Safety
Public static (Shared in Visual Basic)staticShared members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
See Also
Documentation version 1.0.0.0.