- Code: Select all
Public Sub FindAndReplace()
DTE.Find.SearchPath = "Entire Solution"
DTE.Find.FindWhat = "[source]{.*}[/source]"
DTE.Find.Target = vsFindTarget.vsFindTargetSolution
DTE.Find.MatchCase = False
DTE.Find.MatchInHiddenText = True
DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxRegExpr
DTE.Find.Action = vsFindAction.vsFindActionFind
Dim results = DTE.Find.Execute //this doesn't actually return the results; how do I capture them?
DTE.Find.FindWhat = "[destination]{.*}[/destination]"
DTE.Find.FindAction = vsFindActionReplaceAll
DTE.FindTarget = vsFindTargetSolution
DTE.Find.ReplaceWith = results
DTE.Find.Execute
End Sub
I've tried everything I can think of and I've searched several forums....it's all just people asking how a regex works. Any thoughts?
