Created
April 25, 2012 07:29
-
-
Save rsleggett/2487756 to your computer and use it in GitHub Desktop.
Simple TBB for replacing Label delimiters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//The alternative uses $$Label$$ | |
const string pattern = @"\$\$([A-Za-z0-9_-]+)\$\$"; | |
//Replacement regex for %%Label%% | |
const string replacement = "%%$1%%"; | |
Item output = package.GetByName(Package.OutputName); | |
string outputString = Regex.Replace(output.GetAsString(), pattern, replacement); | |
output.SetAsString(outputString); | |
package.PushItem(Package.OutputName, output); | |
base.Transform(engine, package); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment