fork download
  1. Imports System
  2. Imports System.Text.RegularExpressions
  3.  
  4. Public Class Test
  5. Public Shared Sub Main()
  6. Dim texto As String = "if Argumento1 = Argumento2 ( --statements; );"
  7. Dim argumento1 As String = "", argumento2 As String = ""
  8.  
  9. Dim match As Match = Regex.Match(texto, "if\s+([\w]+)\s+=\s+([\w]+)\s+\(", RegexOptions.IgnoreCase)
  10. If match.Success Then
  11. argumento1 = match.Groups(1).Value
  12. argumento2 = match.Groups(2).Value
  13. End If
  14. Console.WriteLine(String.Format("Arg1: {0}, Arg2: {1}", argumento1, argumento2))
  15. Console.ReadLine()
  16. End Sub
  17. End Class
Success #stdin #stdout 0.09s 24488KB
stdin
Standard input is empty
stdout
Arg1: Argumento1, Arg2: Argumento2