Regular Expressions 101

Save & Share

  • Regex Version: ver. 1
  • 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

$re = '/(?<= --> ).*(?=\D+|\$)/m'; $str = '1 00:00:07,200 --> 00:00:10,880 Hi, I\'m Jack Shepard and I\'m a 3D artist for video games. 2 00:00:12,640 --> 00:00:16,800 Throughout my career, I\'ve done more than nine AAA projects, 3 00:00:16,800 --> 00:00:18,360 including "Metro Exodus," 4 00:00:18,360 --> 00:00:21,720 "Call of Duty: WWII" and "Overkill\'s The Walking Dead." 5 00:00:21,720 --> 00:00:25,920 I work as Supervising Environment and Prop Artist at elite3D, 6 00:00:25,920 --> 00:00:27,960 a video game outsourcing company. 7 00:00:29,400 --> 00:00:32,720 From a young age, video games were very present in my life, 8 00:00:32,720 --> 00:00:35,880 I really enjoyed drawing and writing my own stories. 9 00:00:35,880 --> 00:00:38,240 I\'m passionate about all the hidden stories 10 00:00:38,240 --> 00:00:40,560 behind the textures of the props and assets, 11 00:00:40,560 --> 00:00:44,560 the objects used to decorate the game\'s scenes or world. 12 00:00:44,560 --> 00:00:47,720 Everything has a story, even if it\'s an inanimate object. 13 00:00:48,800 --> 00:00:51,280 In this course, you\'ll find out 14 00:00:51,280 --> 00:00:54,280 what creating props and other video game objects consists of. 15 00:00:54,280 --> 00:00:57,560 Plus, how to make them professional quality. 16 00:00:58,160 --> 00:01:00,080 As a project, we\'ll model a prop 17 00:01:00,080 --> 00:01:02,280 that could be in any video game. 18 00:01:03,000 --> 00:01:05,920 To do this, I\'ll share sources of inspiration with you 19 00:01:05,920 --> 00:01:07,920 that marked the beginning of my career. 20 00:01:07,920 --> 00:01:10,880 After, we\'ll learn the phases or the pipeline to follow 21 00:01:10,880 --> 00:01:12,720 for developing our asset. 22 00:01:12,720 --> 00:01:16,320 We\'ll find out how to configure our software and scripts 23 00:01:16,320 --> 00:01:18,040 to save time working. 24 00:01:18,040 --> 00:01:21,000 We\'ll also look at the importance of having good references 25 00:01:21,000 --> 00:01:22,600 before we start modeling. 26 00:01:23,040 --> 00:01:25,840 With this knowledge, we\'ll get typing 27 00:01:25,840 --> 00:01:27,800 to start modeling our asset. 28 00:01:28,600 --> 00:01:32,160 First we\'ll do the block out to figure out the prop\'s dimensions 29 00:01:32,160 --> 00:01:35,080 and get an idea of the pieces that we\'ll need 30 00:01:35,080 --> 00:01:37,040 to estimate how long this will take us. 31 00:01:37,040 --> 00:01:40,440 Then, the high poly phase, first with the Sub-D elements, 32 00:01:40,440 --> 00:01:43,600 with containment and support loops in the more complex pieces. 33 00:01:43,600 --> 00:01:47,200 Later, with Zbrush, we\'ll look at how to weld high poly pieces 34 00:01:47,200 --> 00:01:51,040 and finally, we\'ll give our asset details with floaters and screws. 35 00:01:51,680 --> 00:01:55,440 Then, the low phase to reduce the poly of our high poly 36 00:01:55,440 --> 00:01:59,600 followed by UV mapping and bakes to project detail. 37 00:01:59,960 --> 00:02:03,040 We\'ll work with the substance painter to texturize, 38 00:02:03,040 --> 00:02:06,720 we\'ll create our base materials to give them history and realism. 39 00:02:07,480 --> 00:02:09,400 With our finished asset, 40 00:02:09,400 --> 00:02:12,920 we\'ll see the steps to integrate it into our game motor. 41 00:02:12,920 --> 00:02:15,520 Lastly, we\'ll illuminate our asset in Marmoset 42 00:02:15,520 --> 00:02:19,840 and we\'ll retouch it in Photoshop before posting it on social media. 43 00:02:19,840 --> 00:02:22,120 After the course, you\'ll have a complete model 44 00:02:22,120 --> 00:02:24,840 with realistic textures to use in video games. 45 00:02:26,320 --> 00:02:29,440 For this course, you should have a basic knowledge 46 00:02:29,440 --> 00:02:32,040 of hard surface or poly modeling. 47 00:02:32,040 --> 00:02:36,040 Plus, familiarity with 3ds Max would be very helpful, 48 00:02:36,040 --> 00:02:39,840 however, if you know a different one, you can follow the course\'s content. 49 00:02:40,240 --> 00:02:43,600 You\'ll need a computer with 3ds Max or similar for modeling 50 00:02:43,600 --> 00:02:47,120 and Photoshop CS6 or higher for final retouches on the object. 51 00:02:48,000 --> 00:02:49,320 Create assets from scratch 52 00:02:49,320 --> 00:02:52,160 and do modeling projects on a professional level.'; 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