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 = '/Try4/m'; $str = '"video_title":"Chubby soccer mom sucking my cock during her sons game","defaultQuality":[480,240,720,1080],"vcServerUrl":"/svvt/add?stype=svv&svalue=144220772&snonce=3k67cq1v75q08d5h&skey=d54d83fdbca0384744bb27bf56d0c39f74e6b2e5e4490f7d05a4773cd9cafc9d&stime=1533904546","mediaDefinitions":[{"defaultQuality":false,"format":"","quality":"720","videoUrl":"https:\\/\\/cm.phncdn.com\\/videos\\/201712\\/06\\/144220772\\/720P_1500K_144220772.mp4?a5dcae8e1adc0bdaed975f0d67fb5e0527c20903c5bb57a6cad7e6cb50bc41fbb1152c24e90ee00089707faf83a48b0631cd7479dffc2060a6d86c67ff7a531018f946c76d7a90223ed0660403e56d48f38587e8865385eee2ba6800345b3564d8e27cbebdbf1c324d3092a7a31c91a9f705b96ae23e990ed71f6929"},{"defaultQuality":true,"format":"","quality":"480","videoUrl":"https:\\/\\/cm.phncdn.com\\/videos\\/201712\\/06\\/144220772\\/480P_600K_144220772.mp4?a5dcae8e1adc0bdaed975f0d61fb5e05756dc4acc488d2f9e61ef33953093512602c6cb1feb47ccb32fd98cd23c755b8cdbf7a9890d664e602723582b30988133baddbeb83ade964edb9de64d8e1637aaa565ddbe42bb3ee112441b08ff97869c450ddf0887175b8162a539a64c6da6c65beaf7340cc19259733"},{"defaultQuality":false,"format":"","quality":"240","videoUrl":"https:\\/\\/cm.phncdn.com\\/videos\\/201712\\/06\\/144220772\\/240P_400K_144220772.mp4?a5dcae8e1adc0bdaed975f0d61fb5e05756dc4acc488d2f9e61ef33953093512602c6cb1feb47ccb32fd98cd23c755b8cdbf7a9890d664e05ed88854c611d6e4cf8640f121d46bf195f87aad88d2bc49b870c397aaaf3740ddd4338b880b870d748a26177f0387df5c90111ecbb530b2d75e19578fb83ff8f1dc '; 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