Note that there are some explanatory texts on larger screens.

plurals
  1. POParsing windows 'ipconfig /all' output
    primarykey
    data
    text
    <p>I am having a bit of trouble parsing the output of 'ipconfig /all' using a regex. Currently I am using RegexBuddy for testing, but I want to use the regex in C#.NET.</p> <p>My output is:</p> <pre><code>Ethernet adapter Yes: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : MAC Bridge Miniport Physical Address. . . . . . . . . : 02-1F-29-00-85-C9 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::f980:c9c3:a574:37a%24(Preferred) Link-local IPv6 Address . . . . . : fe80::f980:c9c3:a574:37a7%24(Preferred) Link-local IPv6 Address . . . . . : fe80::f980:c9c3:a574:37a8%24(Preferred) IPv4 Address. . . . . . . . . . . : 10.0.0.1(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.0.0 IPv4 Address. . . . . . . . . . . : 172.16.0.1(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 172.16.0.254 DHCPv6 IAID . . . . . . . . . . . : 520228888 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-17-1C-CC-CF-00-1F-29-00-85-C9 DNS Servers . . . . . . . . . . . : 192.162.100.15 192.162.100.16 NetBIOS over Tcpip. . . . . . . . : Enabled </code></pre> <p>The regex I have written so far is:</p> <pre><code>([ -~]+):.+(?:Description\s)(?:\.|\s)+:\s([ -~]+).+(?:Physical Address)(?:\.|\s)+:\s([ -~]+).+(?:DHCP Enabled)(?:\.|\s)+:\s([ -~]+).+(?:(?:Link-local IPv6 Address)(?:\.|\s)+:\s([ -~]+).+Preferred.+)+ </code></pre> <p>The problem is that I want to capture all the useful fields as groups, to get them easily in C#, and for some reason - when I got to capture the multiple 'Link-local IPv6 Address' fields, it stopped working.</p> <p>I'll appreciate any help, Thanks.</p> <p>Edit: Another problem is that I receive the ipconfig data from a remote machine (there is an unmanaged program there which I don't have control of) - thus I can't use WMI or something like that to get the ipconfig info in another way.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload