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

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

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 AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm