Imports System
Imports System.Text.RegularExpressions
Public Class Test
Public Shared Sub Main()
Dim texto As String = "if Argumento1 = Argumento2 ( --statements; );"
Dim argumento1 As String = "", argumento2 As String = ""
Dim match As Match = Regex.Match(texto, "if\s+([\w]+)\s+=\s+([\w]+)\s+\(", RegexOptions.IgnoreCase)
If match.Success Then
argumento1 = match.Groups(1).Value
argumento2 = match.Groups(2).Value
End If
Console.WriteLine(String.Format("Arg1: {0}, Arg2: {1}", argumento1, argumento2))
Console.ReadLine()
End Sub
End Class
SW1wb3J0cyBTeXN0ZW0KSW1wb3J0cyBTeXN0ZW0uVGV4dC5SZWd1bGFyRXhwcmVzc2lvbnMKClB1YmxpYyBDbGFzcyBUZXN0CglQdWJsaWMgU2hhcmVkIFN1YiBNYWluKCkKCQlEaW0gdGV4dG8gQXMgU3RyaW5nID0gImlmIEFyZ3VtZW50bzEgPSBBcmd1bWVudG8yICggLS1zdGF0ZW1lbnRzOyApOyIKICAgICAgICBEaW0gYXJndW1lbnRvMSBBcyBTdHJpbmcgPSAiIiwgYXJndW1lbnRvMiBBcyBTdHJpbmcgPSAiIgoKICAgICAgICBEaW0gbWF0Y2ggQXMgTWF0Y2ggPSBSZWdleC5NYXRjaCh0ZXh0bywgImlmXHMrKFtcd10rKVxzKz1ccysoW1x3XSspXHMrXCgiLCBSZWdleE9wdGlvbnMuSWdub3JlQ2FzZSkKICAgICAgICBJZiBtYXRjaC5TdWNjZXNzIFRoZW4KICAgICAgICAgICAgYXJndW1lbnRvMSA9IG1hdGNoLkdyb3VwcygxKS5WYWx1ZQogICAgICAgICAgICBhcmd1bWVudG8yID0gbWF0Y2guR3JvdXBzKDIpLlZhbHVlCiAgICAgICAgRW5kIElmCiAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUoU3RyaW5nLkZvcm1hdCgiQXJnMTogezB9LCBBcmcyOiB7MX0iLCBhcmd1bWVudG8xLCBhcmd1bWVudG8yKSkKICAgICAgICBDb25zb2xlLlJlYWRMaW5lKCkKCUVuZCBTdWIKRW5kIENsYXNz