Regular Expressions 101

Save & Manage Regex

  • Current Version: 1
  • Save & Share
  • Community Library

Flavor

  • PCRE2 (PHP)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java
  • .NET 7.0 (C#)
  • Rust
  • PCRE (Legacy)
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests
Sponsors
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
Processing...

Test String

Code Generator

Generated Code

$re = '/\d{5}[Dd]0\d{2}/m'; $str = 'Client MAC Addr IP Address(Ipv4/Ipv6) AP Name WLAN Profile WLAN SSID User Name Protocol Status Auth Port Slot Id Tunnel Fastlane PMIPv6 WGB Device Type Fabric Status U3 Interface 10:02:b5:27:55:b5 10.1.175.32 0175AP3 bunker bunker 00175D048.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 10:02:b5:84:a3:2d 10.1.125.31 0125AP3 bunker bunker 00125D041.dcsg.com 802.11ac Associated Yes 8 1 No No No No Windows7-Workstation Disable 10:02:b5:b6:60:d9 10.2.179.39 0279AP88 bunker bunker 00279D041.dcsg.com 802.11ac Associated Yes 8 1 No No No No Intel-Device Disable 10:02:b5:b7:52:ff 10.11.141.33 1141AP1 bunker bunker 01141D049.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 10:02:b5:db:4b:65 10.4.151.30 0451AP5 bunker bunker 00451D045.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 10:02:b5:dd:0c:5c 10.4.143.32 0443AP3 bunker bunker 00443D045.dcsg.com 802.11bn Associated Yes 8 0 No No No No Intel-Device Disable 10:02:b5:df:c2:da 10.6.107.30 0607AP3 bunker bunker 00607D041.dcsg.com 802.11ac Associated Yes 8 1 No No No No Intel-Device Disable 18:5e:0f:49:64:d4 10.1.181.35 0181AP7 bunker bunker 00181D050.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 18:5e:0f:74:ea:fa 10.6.123.33 0623AP88 bunker bunker 00623D046.dcsg.com 802.11ac Associated Yes 8 1 No No No No Windows7-Workstation Disable 18:5e:0f:c0:b5:f7 10.4.111.34 0411AP8 bunker bunker 00411D048.dcsg.com 802.11ac Associated Yes 8 1 No No No No Intel-Device Disable 18:5e:0f:c2:31:fc 10.46.111.22 4611AP16 bunker bunker 04611D060.dcsg.com 802.11bn Associated Yes 8 0 No No No No Intel-Device Disable 18:5e:0f:ee:41:20 10.11.177.33 1177AP5 bunker bunker 01177D046.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 18:5e:0f:ee:9e:72 10.12.139.32 1239AP11 bunker bunker 01239D046.dcsg.com 802.11bn Associated Yes 8 0 No No No No Intel-Device Disable 34:f6:4b:8a:db:8f 10.11.107.31 1107AP3 bunker bunker 01107D040.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 44:03:2c:46:ba:cc 10.11.175.30 1175AP6 bunker bunker 01175D040.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:21:91:9d 10.46.119.24 4619AP10 bunker bunker 04619D014.dcsg.com 802.11ac Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:22:d9:bd 10.2.125.35 0225AP6 bunker bunker 00225D047.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:66:79:de 10.9.129.32 0929AP2 bunker bunker 00929D046.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:68:69:1f 10.11.119.33 1119AP8 bunker bunker 01119D048.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:75:16:ab 10.12.105.30 1205AP3 bunker bunker 01205D040.dcsg.com 802.11bn Associated Yes 8 0 No No No No Intel-Device Disable 48:45:20:75:8e:38 10.0.135.33 0035AP5 bunker bunker 00035D046.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:7c:fb:05 10.10.139.30 1039AP12 bunker bunker 01039D040.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:7d:10:2c 10.2.121.37 0221AP9 bunker bunker 00221D049.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:7e:b6:02 10.11.103.31 1103AP11 bunker bunker 01103D045.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:97:db:05 10.2.141.34 0241AP4 bunker bunker 00241D041.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:97:f3:d8 10.7.113.30 0713AP10 bunker bunker 00713D046.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:98:c2:36 10.7.117.39 0717AP6 bunker bunker 00717D041.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:9a:30:e9 10.1.177.33 0177AP3 bunker bunker 00177D050.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:b1:97:d4 10.0.177.32 0077AP3 bunker bunker 00077D049.dcsg.com 802.11bn Associated Yes 8 0 No No No No Intel-Device Disable 48:45:20:b9:ed:76 10.0.137.32 0037AP8 bunker bunker 00037D050.dcsg.com 802.11ac Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:ba:f4:d7 10.4.137.31 0437AP9 bunker bunker 00437D047.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:bb:ff:49 10.1.199.36 0199AP7 bunker bunker 00199D050.dcsg.com 802.11bn Associated Yes 8 0 No No No No Intel-Device Disable 48:45:20:c8:7d:64 10.1.105.35 0105AP9 bunker bunker 00105D047.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 48:45:20:fe:0b:14 10.0.197.34 0097AP10 bunker bunker 00097D047.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 4c:34:88:fb:ed:07 10.10.127.30 1027AP3 bunker bunker 01027D046.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 4c:34:88:fb:ed:57 10.11.143.30 1143AP7 bunker bunker 01143D046.dcsg.com 802.11bn Associated Yes 8 0 No No No No Intel-Device Disable 7c:b0:c2:a4:8a:17 10.6.197.31 0697AP6 bunker bunker 00697D045.dcsg.com 802.11ac Associated Yes 8 1 No No No No Intel-Device Disable 7c:b0:c2:af:bc:98 10.3.169.34 0369AP7 bunker bunker 00369D041.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 7c:b0:c2:ce:6e:13 10.46.107.30 4607AP12 bunker bunker 04607D059.dcsg.com 802.11ac Associated Yes 8 1 No No No No Intel-Device Disable 7c:b0:c2:ec:aa:a4 10.46.125.39 4625AP26 bunker bunker 04625D021.dcsg.com 802.11ac Associated Yes 8 1 No No No No Intel-Device Disable 88:78:73:38:c6:83 10.11.187.30 1187AP6 bunker bunker 01187D040.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 88:78:73:65:50:04 10.9.121.30 0921AP9 bunker bunker 00921D043.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 88:78:73:6b:88:66 10.46.115.23 4615AP22 bunker bunker 04615D057.dcsg.com 802.11bn Associated Yes 8 0 No No No No Intel-Device Disable 88:78:73:7a:36:c7 10.2.123.38 0223AP11 bunker bunker 00223D044.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 88:78:73:d5:1c:77 10.10.101.32 1001AP3 bunker bunker 01001D047.dcsg.com 802.11bn Associated Yes 8 0 No No No No Intel-Device Disable 88:78:73:e6:6e:f0 10.46.103.23 4603AP16 bunker bunker 04603D058.dcsg.com 802.11bn Associated Yes 8 0 No No No No Intel-Device Disable 88:78:73:e7:c0:43 10.1.135.33 0135AP7 bunker bunker 00135D028.dcsg.com 802.11bn Associated Yes 8 0 No No No No Intel-Device Disable 88:78:73:e8:58:91 10.6.173.30 0673AP12 bunker bunker 00673D047.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable 9c:da:3e:d1:32:83 10.0.179.31 0079AP3 bunker bunker 00079D048.dcsg.com 802.11n Associated Yes 8 1 No No No No Windows7-Workstation Disable a4:02:b9:45:53:a8 10.2.105.32 0205AP3 bunker bunker 00205D049.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable a4:02:b9:49:81:c1 10.6.167.41 0667AP6 bunker bunker 00667D045.dcsg.com 802.11bn Associated Yes 8 0 No No No No Intel-Device Disable a4:02:b9:52:9e:5a 10.7.153.31 0753AP7 bunker bunker 00753D046.dcsg.com 802.11bn Associated Yes 8 0 No No No No Intel-Device Disable a4:02:b9:66:78:5d 10.10.175.31 1075AP3 bunker bunker 01075D046.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable a4:02:b9:ba:11:de 10.6.189.33 0689AP3 bunker bunker 00689D047.dcsg.com 802.11bn Associated Yes 8 0 No No No No Intel-Device Disable a4:02:b9:e5:9e:d5 10.8.145.33 0845AP7 bunker bunker 00845D001.dcsg.com 802.11ac Associated Yes 8 1 No No No No Intel-Device Disable ac:ed:5c:30:90:bc 10.10.179.31 1079AP6 bunker bunker 01079D046.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable ac:ed:5c:6d:cf:68 10.46.109.37 4609AP25 bunker bunker 04609D046.dcsg.com 802.11ac Associated Yes 8 1 No No No No Intel-Device Disable cc:2f:71:50:e1:e6 10.6.143.48 0643AP7 bunker bunker 00643D040.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable d0:57:7b:d6:5e:2f 10.4.115.31 0415AP16 bunker bunker 00415D055.dcsg.com 802.11ac Associated Yes 8 1 No No No No Windows7-Workstation Disable d0:57:7b:dd:93:16 10.11.173.30 1173AP6 bunker bunker 01173D045.dcsg.com 802.11ac Associated Yes 8 1 No No No No Intel-Device Disable e4:42:a6:77:37:a1 10.2.143.35 0243AP3 bunker bunker 00243D048.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable f4:96:34:ab:c3:22 10.6.191.30 0691AP5 bunker bunker 00691D047.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable f8:34:41:71:81:d0 10.9.127.30 0927AP5 bunker bunker 00927D046.dcsg.com 802.11n Associated Yes 8 1 No No No No Intel-Device Disable '; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); // Print the entire match result var_dump($matches);

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 PHP, please visit: http://php.net/manual/en/ref.pcre.php