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
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
Processing...

Test String

Code Generator

Generated Code

$re = '/(\d\d:\d\d - \d\d:\d\d)/m'; $str = 'Yuri Furusho (WORK), CD Vacation Time Mon Oct 28, 2019 11:00 - 11:30 CD Sprint Kickoff Video call: https://meet.google.com/ruf-swic-wps Phone number: tel:+1-937-506-6349 PIN: 512139043 Calendar: Rylan Halteman 13:00 - 13:45 Weekly All Hands Where: Main-3-Wattpad Office Events (80) Calendar: Gina Freitag Created by: Rebecca Sands 14:30 - 15:00 Android Regression Testing Where: Kitchen Calendar: Rashad Sookram 15:00 - 15:30 Quick chat about continue reading Video call: https://meet.google.com/kym-kjuh-epj Phone number: tel:+1-226-213-9130 PIN: 567206490 Calendar: Zoe DiNovi 15:00 - 17:00 Squad CD: Open Meeting Block Calendar: Rylan Halteman Tue Oct 29, 2019 11:30 - 13:30 Wattpad + LifeLabs: Feedback Skills Video call: https://meet.google.com/nnd-yrpk-hzy Phone number: tel:+1-650-394-7019 PIN: 115228211 Where: 42-Baka Sakali Calendar: Su Zielinski 13:00 - 17:00 Squad CD: No Recurring Meetings Video call: https://meet.google.com/eir-gdqb-pty Phone number: tel:+1-484-424-6792 PIN: 404661941 Calendar: Rylan Halteman Wed Oct 30, 2019 10:50 - 11:00 CD Standup Video call: https://meet.google.com/wjc-jgcu-zoy Phone number: tel:+1-662-792-0993 PIN: 569887053 Calendar: Rylan Halteman Created by: Adriel Dean-Hall 11:30 - 12:00 Brandon Yuri 1:1 Video call: https://meet.google.com/xaq-tryr-kau Phone number: tel:+1-813-948-2356 PIN: 873696570 Where: Main-2-The Cellar (2) Calendar: Brandon Zhao 12:00 - 13:00 Core Lunch \'N Learn (Optional) Where: Wattpad Kitchen , https://zoom.us/j/929891174 Calendar: Gina Freitag 13:30 - 14:00 Rylan Yuri sprint planning Video call: https://meet.google.com/trx-xpts-ncr Phone number: tel:+1-929-276-1322 PIN: 535064633 Where: Main-3-Kitchen TV Area (10) Thu Oct 31, 2019 12:00 - 13:00 Annual HalloWattys (A Wattpad Halloween Costume Contest) Video call: https://meet.google.com/mbp-uvjp-pfu Phone number: tel:+1-502-547-4437 PIN: 768243398 Where: Kitchen , Main-3-Kitchen TV Area (10) Calendar: Emily Nguyen 16:00 - 16:15 Cheers & Celebrations Where: Main-3-Wattpad Office Events (80) Calendar: Su Zielinski Yuri Furusho (WORK), CD Vacation Time Fri Nov 1, 2019 10:50 - 11:00 CD Standup Video call: https://meet.google.com/wjc-jgcu-zoy Phone number: tel:+1-662-792-0993 PIN: 569887053 Calendar: Rylan Halteman 13:00 - 14:00 FLU SHOT Mon Nov 4, 2019 10:50 - 11:00 CD Standup Video call: https://meet.google.com/wjc-jgcu-zoy Phone number: tel:+1-662-792-0993 PIN: 569887053 Where: Our Pod Calendar: Rylan Halteman 13:00 - 13:45 Weekly All Hands Where: Main-3-Wattpad Office Events (80) Calendar: Gina Freitag Created by: Rebecca Sands 14:30 - 15:00 Android Regression Testing Where: Kitchen Calendar: Rashad Sookram 15:00 - 17:00 Squad CD: Open Meeting Block Calendar: Rylan Halteman 15:30 - 17:00 Squad Retro Video call: https://meet.google.com/nag-btic-tje Phone number: tel:+1-929-276-1119 PIN: 353450953 Where: Main-3-Chasing Red (14) [Conference Phone, Video Conference] Calendar: Rylan Halteman Tue Nov 5, 2019 13:00 - 17:00 Squad CD: No Recurring Meetings Video call: https://meet.google.com/eir-gdqb-pty Phone number: tel:+1-484-424-6792 PIN: 404661941 Calendar: Rylan Halteman Wed Nov 6, 2019 09:00 - 10:45 Plan for next Sprint 10:50 - 11:00 CD Standup Video call: https://meet.google.com/wjc-jgcu-zoy Phone number: tel:+1-662-792-0993 PIN: 569887053 Calendar: Rylan Halteman Created by: Adriel Dean-Hall 11:30 - 12:00 Brandon Yuri 1:1 Video call: https://meet.google.com/xaq-tryr-kau Phone number: tel:+1-813-948-2356 PIN: 873696570 Where: Main-2-The Cellar (2) Calendar: Brandon Zhao 13:30 - 14:00 Yuri + Zoe meet! Video call: https://meet.google.com/zxc-jnra-hwu Phone number: tel:+1-470-485-9853 PIN: 729936893 Where: Main-3-White Stag (6) Calendar: Zoe DiNovi 14:30 - 15:00 CD - Client Estimations Video call: https://meet.google.com/odn-pmak-qgr Phone number: tel:+1-530-428-6641 PIN: 202981230 Where: Main-2-Light As A Feather (6) [Conference Phone, Webcam] Calendar: Rylan Halteman 15:00 - 17:00 CD Estimations - 1hr Video call: https://meet.google.com/edz-bjgu-aug Phone number: tel:+1-262-427-8058 PIN: 632357260 Where: Main-3-Death Is My BFF (10) [Conference Phone, Video Conference] Calendar: Rylan Halteman Created by: Zoe DiNovi Yuri Furusho (WORK), CD Vacation Time Thu Nov 7, 2019 11:00 - 11:45 CD Sprint Retro Video call: https://meet.google.com/aos-kyxd-vjv Phone number: tel:+1-470-238-8091 PIN: 103725028 Where: Main-3-Chasing Red (14) [Conference Phone, Video Conference] Calendar: Rylan Halteman Created by: Zoe DiNovi 13:30 - 14:30 Guild Android Meeting Video call: https://meet.google.com/ctr-hmos-chy Phone number: tel:+1-318-431-0871 PIN: 740066937 Where: Main-3-Chasing Red (14) [Conference Phone, Video Conference] Calendar: Rashad Sookram 16:00 - 18:30 Family Feud 2019 Edition Video call: https://meet.google.com/oaz-cqvq-izo Phone number: tel:+1-226-314-8544 PIN: 900323491 Where: HQ Kitchen, (Shared)-Main-Wattpad - Learning & Development Calendar: Emma Brooks Fri Nov 8, 2019 10:30 - 13:00 Guild Android Working Session Video call: https://meet.google.com/bvu-zpbr-idg Phone number: tel:+1-929-445-0869 PIN: 193571697 Where: Main-3-Chasing Red (14) [Conference Phone, Video Conference] Calendar: Rashad Sookram 13:00 - 14:00 Guild Android Self Paid Lunch Video call: https://meet.google.com/rwk-auic-xrt Phone number: tel:+1-413-276-7819 PIN: 319785391 Calendar: Ian Ko '; 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