Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim t = uc.NewTransformer()
      t.Text = "Config { setting = 123; }"
      
      '// 1. Define the parent rule to capture the content inside the braces.
      Dim parentRule = t.Pattern("Config '{' {body} '}'").SetStatementSensitive(false)
      
      '// 2. Get the local transformer for the parent rule.
      Dim local_t = parentRule.LocalTransformer
      
      '// 3. Define a rule that operates ONLY on the text captured by '{body}'.
      local_t.FromTo("setting = {val}", "Found Value: {val}")
      
      '// 4. Perform the transformation.
      '// The local rule will run on the text " setting = 123; ".
      t.Transform()
      
      Console.WriteLine(t.Text)
   End Sub
End Module