Expresión regular para hacer coincidir los argumentos del proceso
Tengo esta cadena:
Process.exe /Switch=Value /Switch="C:\Path with spaces\file.txt" wrong argument
Me gustaría capturar estas partes:
· 1st Match: Process.exe
· 2nd Match: /Switch=Value
· 3rd Match: /Switch="C:\Path with spaces\file.txt"
· 4th Match: wrong
· 5th Match: argument
La expresión regular debe ser para uso genérico (un proceso con argumentos reales), no solo para adaptarse a este caso.
Esto es lo que estoy intentando:
Dim DebugArguments As String =
"HotkeyMaker.exe /Hotkey=Escape /run=""c:\folder with spaces\notepad.exe"""
For Each match As Match In Regex.Matches(DebugArguments, "([^\s]+[^""])")
MsgBox(match.Value)
Next match