Regular Expressions 101

Save & Share

  • Regex Version: ver. 2
  • Update Regex
    ctrl+⇧+s
  • Save new Regex
    ctrl+s
  • Add to Community Library

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8
  • .NET 7.0 (C#)
  • Rust
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests

Tools

Sponsors
There are currently no sponsors. Become a sponsor today!
An explanation of your regex will be automatically generated as you type.
Detailed match information will be displayed here automatically.
  • All Tokens
  • Common Tokens
  • General Tokens
  • Anchors
  • Meta Sequences
  • Quantifiers
  • Group Constructs
  • Character Classes
  • Flags/Modifiers
  • Substitution
  • A single character of: a, b or c
    [abc]
  • A character except: a, b or c
    [^abc]
  • A character in the range: a-z
    [a-z]
  • A character not in the range: a-z
    [^a-z]
  • A character in the range: a-z or A-Z
    [a-zA-Z]
  • Any single character
    .
  • Alternate - match either a or b
    a|b
  • Any whitespace character
    \s
  • Any non-whitespace character
    \S
  • Any digit
    \d
  • Any non-digit
    \D
  • Any word character
    \w
  • Any non-word character
    \W
  • Non-capturing group
    (?:...)
  • Capturing group
    (...)
  • Zero or one of a
    a?
  • Zero or more of a
    a*
  • One or more of a
    a+
  • Exactly 3 of a
    a{3}
  • 3 or more of a
    a{3,}
  • Between 3 and 6 of a
    a{3,6}
  • Start of string
    ^
  • End of string
    $
  • A word boundary
    \b
  • Non-word boundary
    \B

Regular Expression

/
/
gm

Test String

Code Generator

Generated Code

import java.util.regex.Matcher; import java.util.regex.Pattern; public class Example { public static void main(String[] args) { final String regex = "NIC 1 Rule\\(0\\):.*?ip = ([\\d.]{7,15}).*?port = (\\d{1,5})"; final String string = "Name: MEmu\n" + "Groups: /\n" + "Guest OS: Other Linux (32-bit)\n" + "UUID: 20201029-aaaa-aaaa-aaaa-000000000000\n" + "Config file: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu\\MEmu.memu\n" + "Snapshot folder: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu\\Snapshots\n" + "Log folder: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu\\Logs\n" + "Hardware UUID: 20201029-aaaa-aaaa-aaaa-000000000000\n" + "Memory size: 512MB\n" + "Page Fusion: off\n" + "VRAM size: 12MB\n" + "CPU exec cap: 100%\n" + "HPET: off\n" + "Chipset: piix3\n" + "Firmware: BIOS\n" + "Number of CPUs: 1\n" + "PAE: on\n" + "Long Mode: on\n" + "Triple Fault Reset: off\n" + "APIC: on\n" + "X2APIC: off\n" + "CPUID Portability Level: 0\n" + "CPUID overrides: None\n" + "Boot menu mode: disabled\n" + "Boot Device (1): HardDisk\n" + "Boot Device (2): Not Assigned\n" + "Boot Device (3): Not Assigned\n" + "Boot Device (4): Not Assigned\n" + "ACPI: on\n" + "IOAPIC: on\n" + "BIOS APIC mode: APIC\n" + "Time offset: 0ms\n" + "RTC: UTC\n" + "Hardw. virt.ext: on\n" + "Nested Paging: on\n" + "Large Pages: on\n" + "VT-x VPID: on\n" + "VT-x unr. exec.: on\n" + "Paravirt. Provider: Legacy\n" + "Effective Paravirt. Provider: None\n" + "State: running (since 2020-11-15T14:31:01.762000000)\n" + "Monitor count: 1\n" + "3D Acceleration: off\n" + "2D Video Acceleration: off\n" + "Teleporter Enabled: off\n" + "Teleporter Port: 0\n" + "Teleporter Address: \n" + "Teleporter Password: \n" + "Tracing Enabled: off\n" + "Allow Tracing to Access VM: off\n" + "Tracing Configuration: \n" + "Autostart Enabled: off\n" + "Autostart Delay: 0\n" + "Default Frontend: \n" + "Storage Controller Name (0): IDE\n" + "Storage Controller Type (0): PIIX4\n" + "Storage Controller Instance Number (0): 0\n" + "Storage Controller Max Port Count (0): 2\n" + "Storage Controller Port Count (0): 2\n" + "Storage Controller Bootable (0): on\n" + "IDE (0, 0): C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu\\MEmu44-20180125000000FF-disk1.vmdk (UUID: 3c18861c-afbc-4dc5-a282-9e28e6d979d9)\n" + "IDE (0, 1): C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu\\MEmu44-20180125000000FF-disk2.vmdk (UUID: 20201029-cccc-cccc-cccc-000000000000)\n" + "IDE (1, 0): C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu\\MEmu44-20180125000000FF-disk3.vmdk (UUID: 20201029-dddd-dddd-dddd-000000000000)\n" + "NIC 1: MAC: 08002709FE9E, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none\n" + "NIC 1 Settings: MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)\n" + "NIC 1 Rule(0): name = ADB, protocol = tcp, host ip = 127.0.0.1, host port = 21503, guest ip = 10.0.2.15, guest port = 5555\n" + "NIC 1 Rule(1): name = MVD, protocol = tcp, host ip = 127.0.0.1, host port = 21501, guest ip = 10.0.2.15, guest port = 21501\n" + "NIC 2: MAC: 0800279FCBC1, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none\n" + "NIC 2 Settings: MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)\n" + "NIC 3: disabled\n" + "NIC 4: disabled\n" + "NIC 5: disabled\n" + "NIC 6: disabled\n" + "NIC 7: disabled\n" + "NIC 8: disabled\n" + "Pointing Device: USB Tablet\n" + "Keyboard Device: PS/2 Keyboard\n" + "UART 1: disabled\n" + "UART 2: disabled\n" + "UART 3: disabled\n" + "UART 4: disabled\n" + "LPT 1: disabled\n" + "LPT 2: disabled\n" + "Audio: enabled (Driver: Null, Controller: AC97, Codec: STAC9700)\n" + "Clipboard Mode: disabled\n" + "Drag and drop Mode: disabled\n" + "Session name: headless\n" + "VRDE: disabled\n" + "USB: enabled\n" + "EHCI: disabled\n" + "XHCI: disabled\n\n" + "USB Device Filters:\n\n" + "<none>\n\n" + "Bandwidth groups: <none>\n\n" + "Shared folders: \n\n" + "Name: 'music', Host path: 'C:\\Users\\яЕПЦЕИ\\Music\\MEmu Music' (machine mapping), writable\n" + "Name: 'movie', Host path: 'C:\\Users\\яЕПЦЕИ\\Videos\\MEmu Video' (machine mapping), writable\n" + "Name: 'picture', Host path: 'C:\\Users\\яЕПЦЕИ\\Pictures\\MEmu Photo' (machine mapping), writable\n" + "Name: 'download', Host path: 'C:\\Users\\яЕПЦЕИ\\Downloads\\MEmu Download' (machine mapping), writable\n\n" + "Video capturing: not active\n" + "Capture screens: 0\n" + "Capture file: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu\\MEmu.webm\n" + "Capture dimensions: 1024x768\n" + "Capture rate: 512 kbps\n" + "Capture FPS: 25\n\n" + "Guest:\n\n" + "Configured memory balloon size: 0 MB\n\n\n" + "Name: MEmu_1\n" + "Groups: /\n" + "Guest OS: Other Linux (32-bit)\n" + "UUID: 20201112-aaaa-aaaa-aaaa-000000000001\n" + "Config file: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_1\\MEmu_1.memu\n" + "Snapshot folder: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_1\\Snapshots\n" + "Log folder: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_1\\Logs\n" + "Hardware UUID: 20201112-aaaa-aaaa-aaaa-000000000001\n" + "Memory size: 512MB\n" + "Page Fusion: off\n" + "VRAM size: 12MB\n" + "CPU exec cap: 100%\n" + "HPET: off\n" + "Chipset: piix3\n" + "Firmware: BIOS\n" + "Number of CPUs: 1\n" + "PAE: on\n" + "Long Mode: on\n" + "Triple Fault Reset: off\n" + "APIC: on\n" + "X2APIC: off\n" + "CPUID Portability Level: 0\n" + "CPUID overrides: None\n" + "Boot menu mode: disabled\n" + "Boot Device (1): HardDisk\n" + "Boot Device (2): Not Assigned\n" + "Boot Device (3): Not Assigned\n" + "Boot Device (4): Not Assigned\n" + "ACPI: on\n" + "IOAPIC: on\n" + "BIOS APIC mode: APIC\n" + "Time offset: 0ms\n" + "RTC: UTC\n" + "Hardw. virt.ext: on\n" + "Nested Paging: on\n" + "Large Pages: on\n" + "VT-x VPID: on\n" + "VT-x unr. exec.: on\n" + "Paravirt. Provider: Legacy\n" + "Effective Paravirt. Provider: None\n" + "State: running (since 2020-11-15T14:31:02.670000000)\n" + "Monitor count: 1\n" + "3D Acceleration: off\n" + "2D Video Acceleration: off\n" + "Teleporter Enabled: off\n" + "Teleporter Port: 0\n" + "Teleporter Address: \n" + "Teleporter Password: \n" + "Tracing Enabled: off\n" + "Allow Tracing to Access VM: off\n" + "Tracing Configuration: \n" + "Autostart Enabled: off\n" + "Autostart Delay: 0\n" + "Default Frontend: \n" + "Storage Controller Name (0): IDE\n" + "Storage Controller Type (0): PIIX4\n" + "Storage Controller Instance Number (0): 0\n" + "Storage Controller Max Port Count (0): 2\n" + "Storage Controller Port Count (0): 2\n" + "Storage Controller Bootable (0): on\n" + "IDE (0, 0): C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_1\\MEmu44-20180125000000FF-disk1.vmdk (UUID: 20201112-bbbb-bbbb-bbbb-000000000001)\n" + "IDE (0, 1): C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_1\\MEmu44-20180125000000FF-disk2.vmdk (UUID: 20201112-cccc-cccc-cccc-000000000001)\n" + "IDE (1, 0): C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_1\\MEmu44-20180125000000FF-disk3.vmdk (UUID: 20201112-dddd-dddd-dddd-000000000001)\n" + "NIC 1: MAC: 360828098894, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none\n" + "NIC 1 Settings: MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)\n" + "NIC 1 Rule(0): name = ADB, protocol = tcp, host ip = 127.0.0.1, host port = 21513, guest ip = 10.0.2.15, guest port = 5555\n" + "NIC 1 Rule(1): name = MVD, protocol = tcp, host ip = 127.0.0.1, host port = 21511, guest ip = 10.0.2.15, guest port = 21501\n" + "NIC 2: MAC: A8F6B0302130, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none\n" + "NIC 2 Settings: MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)\n" + "NIC 3: disabled\n" + "NIC 4: disabled\n" + "NIC 5: disabled\n" + "NIC 6: disabled\n" + "NIC 7: disabled\n" + "NIC 8: disabled\n" + "Pointing Device: USB Tablet\n" + "Keyboard Device: PS/2 Keyboard\n" + "UART 1: disabled\n" + "UART 2: disabled\n" + "UART 3: disabled\n" + "UART 4: disabled\n" + "LPT 1: disabled\n" + "LPT 2: disabled\n" + "Audio: enabled (Driver: Null, Controller: AC97, Codec: STAC9700)\n" + "Clipboard Mode: disabled\n" + "Drag and drop Mode: disabled\n" + "Session name: headless\n" + "VRDE: disabled\n" + "USB: enabled\n" + "EHCI: disabled\n" + "XHCI: disabled\n\n" + "USB Device Filters:\n\n" + "<none>\n\n" + "Bandwidth groups: <none>\n\n" + "Shared folders: \n\n" + "Name: 'music', Host path: 'C:\\Users\\яЕПЦЕИ\\Music\\MEmu Music' (machine mapping), writable\n" + "Name: 'movie', Host path: 'C:\\Users\\яЕПЦЕИ\\Videos\\MEmu Video' (machine mapping), writable\n" + "Name: 'picture', Host path: 'C:\\Users\\яЕПЦЕИ\\Pictures\\MEmu Photo' (machine mapping), writable\n" + "Name: 'download', Host path: 'C:\\Users\\яЕПЦЕИ\\Downloads\\MEmu Download' (machine mapping), writable\n\n" + "Video capturing: not active\n" + "Capture screens: 0\n" + "Capture file: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_1\\MEmu_1.webm\n" + "Capture dimensions: 1024x768\n" + "Capture rate: 512 kbps\n" + "Capture FPS: 25\n\n" + "Guest:\n\n" + "Configured memory balloon size: 0 MB\n\n\n" + "Name: MEmu_2\n" + "Groups: /\n" + "Guest OS: Other Linux (32-bit)\n" + "UUID: 20201112-aaaa-aaaa-aaaa-000000000002\n" + "Config file: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_2\\MEmu_2.memu\n" + "Snapshot folder: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_2\\Snapshots\n" + "Log folder: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_2\\Logs\n" + "Hardware UUID: 20201112-aaaa-aaaa-aaaa-000000000002\n" + "Memory size: 512MB\n" + "Page Fusion: off\n" + "VRAM size: 12MB\n" + "CPU exec cap: 100%\n" + "HPET: off\n" + "Chipset: piix3\n" + "Firmware: BIOS\n" + "Number of CPUs: 1\n" + "PAE: on\n" + "Long Mode: on\n" + "Triple Fault Reset: off\n" + "APIC: on\n" + "X2APIC: off\n" + "CPUID Portability Level: 0\n" + "CPUID overrides: None\n" + "Boot menu mode: disabled\n" + "Boot Device (1): HardDisk\n" + "Boot Device (2): Not Assigned\n" + "Boot Device (3): Not Assigned\n" + "Boot Device (4): Not Assigned\n" + "ACPI: on\n" + "IOAPIC: on\n" + "BIOS APIC mode: APIC\n" + "Time offset: 0ms\n" + "RTC: UTC\n" + "Hardw. virt.ext: on\n" + "Nested Paging: on\n" + "Large Pages: on\n" + "VT-x VPID: on\n" + "VT-x unr. exec.: on\n" + "Paravirt. Provider: Legacy\n" + "Effective Paravirt. Provider: None\n" + "State: running (since 2020-11-15T14:31:04.475000000)\n" + "Monitor count: 1\n" + "3D Acceleration: off\n" + "2D Video Acceleration: off\n" + "Teleporter Enabled: off\n" + "Teleporter Port: 0\n" + "Teleporter Address: \n" + "Teleporter Password: \n" + "Tracing Enabled: off\n" + "Allow Tracing to Access VM: off\n" + "Tracing Configuration: \n" + "Autostart Enabled: off\n" + "Autostart Delay: 0\n" + "Default Frontend: \n" + "Storage Controller Name (0): IDE\n" + "Storage Controller Type (0): PIIX4\n" + "Storage Controller Instance Number (0): 0\n" + "Storage Controller Max Port Count (0): 2\n" + "Storage Controller Port Count (0): 2\n" + "Storage Controller Bootable (0): on\n" + "IDE (0, 0): C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_2\\MEmu44-20180125000000FF-disk1.vmdk (UUID: 20201112-bbbb-bbbb-bbbb-000000000002)\n" + "IDE (0, 1): C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_2\\MEmu44-20180125000000FF-disk2.vmdk (UUID: 20201112-cccc-cccc-cccc-000000000002)\n" + "IDE (1, 0): C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_2\\MEmu44-20180125000000FF-disk3.vmdk (UUID: 20201112-dddd-dddd-dddd-000000000002)\n" + "NIC 1: MAC: 445929981808, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none\n" + "NIC 1 Settings: MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)\n" + "NIC 1 Rule(0): name = ADB, protocol = tcp, host ip = 127.0.0.1, host port = 21523, guest ip = 10.0.2.15, guest port = 5555\n" + "NIC 1 Rule(1): name = MVD, protocol = tcp, host ip = 127.0.0.1, host port = 21521, guest ip = 10.0.2.15, guest port = 21501\n" + "NIC 2: MAC: A8F5E2EBF25D, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none\n" + "NIC 2 Settings: MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)\n" + "NIC 3: disabled\n" + "NIC 4: disabled\n" + "NIC 5: disabled\n" + "NIC 6: disabled\n" + "NIC 7: disabled\n" + "NIC 8: disabled\n" + "Pointing Device: USB Tablet\n" + "Keyboard Device: PS/2 Keyboard\n" + "UART 1: disabled\n" + "UART 2: disabled\n" + "UART 3: disabled\n" + "UART 4: disabled\n" + "LPT 1: disabled\n" + "LPT 2: disabled\n" + "Audio: enabled (Driver: Null, Controller: AC97, Codec: STAC9700)\n" + "Clipboard Mode: disabled\n" + "Drag and drop Mode: disabled\n" + "Session name: headless\n" + "VRDE: disabled\n" + "USB: enabled\n" + "EHCI: disabled\n" + "XHCI: disabled\n\n" + "USB Device Filters:\n\n" + "<none>\n\n" + "Bandwidth groups: <none>\n\n" + "Shared folders: \n\n" + "Name: 'music', Host path: 'C:\\Users\\яЕПЦЕИ\\Music\\MEmu Music' (machine mapping), writable\n" + "Name: 'movie', Host path: 'C:\\Users\\яЕПЦЕИ\\Videos\\MEmu Video' (machine mapping), writable\n" + "Name: 'picture', Host path: 'C:\\Users\\яЕПЦЕИ\\Pictures\\MEmu Photo' (machine mapping), writable\n" + "Name: 'download', Host path: 'C:\\Users\\яЕПЦЕИ\\Downloads\\MEmu Download' (machine mapping), writable\n\n" + "Video capturing: not active\n" + "Capture screens: 0\n" + "Capture file: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_2\\MEmu_2.webm\n" + "Capture dimensions: 1024x768\n" + "Capture rate: 512 kbps\n" + "Capture FPS: 25\n\n" + "Guest:\n\n" + "Configured memory balloon size: 0 MB\n\n\n" + "Name: MEmu_3\n" + "Groups: /\n" + "Guest OS: Other Linux (32-bit)\n" + "UUID: 20201112-aaaa-aaaa-aaaa-000000000003\n" + "Config file: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_3\\MEmu_3.memu\n" + "Snapshot folder: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_3\\Snapshots\n" + "Log folder: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_3\\Logs\n" + "Hardware UUID: 20201112-aaaa-aaaa-aaaa-000000000003\n" + "Memory size: 512MB\n" + "Page Fusion: off\n" + "VRAM size: 12MB\n" + "CPU exec cap: 100%\n" + "HPET: off\n" + "Chipset: piix3\n" + "Firmware: BIOS\n" + "Number of CPUs: 1\n" + "PAE: on\n" + "Long Mode: on\n" + "Triple Fault Reset: off\n" + "APIC: on\n" + "X2APIC: off\n" + "CPUID Portability Level: 0\n" + "CPUID overrides: None\n" + "Boot menu mode: disabled\n" + "Boot Device (1): HardDisk\n" + "Boot Device (2): Not Assigned\n" + "Boot Device (3): Not Assigned\n" + "Boot Device (4): Not Assigned\n" + "ACPI: on\n" + "IOAPIC: on\n" + "BIOS APIC mode: APIC\n" + "Time offset: 0ms\n" + "RTC: UTC\n" + "Hardw. virt.ext: on\n" + "Nested Paging: on\n" + "Large Pages: on\n" + "VT-x VPID: on\n" + "VT-x unr. exec.: on\n" + "Paravirt. Provider: Legacy\n" + "Effective Paravirt. Provider: None\n" + "State: running (since 2020-11-15T14:31:04.475000000)\n" + "Monitor count: 1\n" + "3D Acceleration: off\n" + "2D Video Acceleration: off\n" + "Teleporter Enabled: off\n" + "Teleporter Port: 0\n" + "Teleporter Address: \n" + "Teleporter Password: \n" + "Tracing Enabled: off\n" + "Allow Tracing to Access VM: off\n" + "Tracing Configuration: \n" + "Autostart Enabled: off\n" + "Autostart Delay: 0\n" + "Default Frontend: \n" + "Storage Controller Name (0): IDE\n" + "Storage Controller Type (0): PIIX4\n" + "Storage Controller Instance Number (0): 0\n" + "Storage Controller Max Port Count (0): 2\n" + "Storage Controller Port Count (0): 2\n" + "Storage Controller Bootable (0): on\n" + "IDE (0, 0): C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_3\\MEmu44-20180125000000FF-disk1.vmdk (UUID: 20201112-bbbb-bbbb-bbbb-000000000003)\n" + "IDE (0, 1): C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_3\\MEmu44-20180125000000FF-disk2.vmdk (UUID: 20201112-cccc-cccc-cccc-000000000003)\n" + "IDE (1, 0): C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_3\\MEmu44-20180125000000FF-disk3.vmdk (UUID: 20201112-dddd-dddd-dddd-000000000003)\n" + "NIC 1: MAC: 366807061729, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none\n" + "NIC 1 Settings: MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)\n" + "NIC 1 Rule(0): name = ADB, protocol = tcp, host ip = 127.0.0.1, host port = 21533, guest ip = 10.0.2.15, guest port = 5555\n" + "NIC 1 Rule(1): name = MVD, protocol = tcp, host ip = 127.0.0.1, host port = 21531, guest ip = 10.0.2.15, guest port = 21501\n" + "NIC 2: MAC: 70A31C00CB3E, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none\n" + "NIC 2 Settings: MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)\n" + "NIC 3: disabled\n" + "NIC 4: disabled\n" + "NIC 5: disabled\n" + "NIC 6: disabled\n" + "NIC 7: disabled\n" + "NIC 8: disabled\n" + "Pointing Device: USB Tablet\n" + "Keyboard Device: PS/2 Keyboard\n" + "UART 1: disabled\n" + "UART 2: disabled\n" + "UART 3: disabled\n" + "UART 4: disabled\n" + "LPT 1: disabled\n" + "LPT 2: disabled\n" + "Audio: enabled (Driver: Null, Controller: AC97, Codec: STAC9700)\n" + "Clipboard Mode: disabled\n" + "Drag and drop Mode: disabled\n" + "Session name: headless\n" + "VRDE: disabled\n" + "USB: enabled\n" + "EHCI: disabled\n" + "XHCI: disabled\n\n" + "USB Device Filters:\n\n" + "<none>\n\n" + "Bandwidth groups: <none>\n\n" + "Shared folders: \n\n" + "Name: 'music', Host path: 'C:\\Users\\яЕПЦЕИ\\Music\\MEmu Music' (machine mapping), writable\n" + "Name: 'movie', Host path: 'C:\\Users\\яЕПЦЕИ\\Videos\\MEmu Video' (machine mapping), writable\n" + "Name: 'picture', Host path: 'C:\\Users\\яЕПЦЕИ\\Pictures\\MEmu Photo' (machine mapping), writable\n" + "Name: 'download', Host path: 'C:\\Users\\яЕПЦЕИ\\Downloads\\MEmu Download' (machine mapping), writable\n\n" + "Video capturing: not active\n" + "Capture screens: 0\n" + "Capture file: C:\\Program Files\\Microvirt\\MEmu\\MemuHyperv VMs\\MEmu_3\\MEmu_3.webm\n" + "Capture dimensions: 1024x768\n" + "Capture rate: 512 kbps\n" + "Capture FPS: 25\n\n" + "Guest:\n\n" + "Configured memory balloon size: 0 MB"; final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE); final Matcher matcher = pattern.matcher(string); while (matcher.find()) { System.out.println("Full match: " + matcher.group(0)); for (int i = 1; i <= matcher.groupCount(); i++) { System.out.println("Group " + i + ": " + matcher.group(i)); } } } }

Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Java, please visit: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html