Feature | EmojiRegex | Traditional Regex |
---|---|---|
Sets | ๐ฟABC๐ |
[ABC] |
Alternates | ๐คA๐B๐ค |
A|B |
Zero or More | A๐ |
A* |
One or More | A๐บ |
A+ |
Zero or One (optional) | A๐ฌ |
A? |
Any Character | โช |
. |
Input Start | ๐ |
^ |
Input End | ๐ |
$ |
Escaping | โ |
\ |
any 'word' character | โ๐ก |
\w |
any 'digit' character | โ๐ข |
\d |
any 'whitespace' character | โโซ |
\s |
Last active
November 25, 2022 01:49
-
-
Save joeskeen/98c9f0e9d04cd6f32d27015e1b88b589 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
๐๏ธ ๐ผ๏ธ ๐ | |
๐๏ธ๐isMatch๐ | |
๐๏ธ๐matchPosition๐ฌ๐ข | |
๐๏ธ๐matchLength๐ฌ๐ข | |
๐ ๐ผisMatch๐ ๐ผmatchPosition๐ฌ๐ข ๐ผmatchLength๐ฌ๐ข ๐๐ | |
๐โถ๏ธ๐ ๐ | |
๐ โก๏ธ ๐๏ธisMatch | |
๐คท โก๏ธ ๐๏ธmatchPosition | |
๐คท โก๏ธ ๐๏ธmatchLength | |
๐ | |
โ๐ โก๏ธ ๐ ๐ | |
โฉ๏ธ isMatch | |
๐ | |
โ๐ฝ โก๏ธ ๐ฌ๐ข ๐ | |
โฉ๏ธ matchPosition | |
๐ | |
โ๐ โก๏ธ ๐ฌ๐ข ๐ | |
โฉ๏ธ matchLength | |
๐ | |
๐ | |
๐ A Regular Expression Engine using Emoji Syntax ๐ | |
๐ ๐ญ ๐ | |
๐๏ธ๐OPEN_SET๐ก โฌ ๏ธ ๐ค๐ฟ๐ค | |
๐๏ธ๐CLOSE_SET๐ก โฌ ๏ธ ๐ค๐๐ค | |
๐๏ธ๐OPEN_GROUP๐ก โฌ ๏ธ ๐ค๐ค๐ค | |
๐๏ธ๐CLOSE_GROUP๐ก โฌ ๏ธ ๐ค๐ค๐ค | |
๐๏ธ๐ALTERNATE๐ก โฌ ๏ธ ๐ค๐๐ค | |
๐๏ธ๐ZERO_TO_MANY๐ก โฌ ๏ธ ๐ค๐๐ค | |
๐๏ธ๐ONE_TO_MANY๐ก โฌ ๏ธ ๐ค๐บ๐ค | |
๐๏ธ๐ZERO_OR_ONE๐ก โฌ ๏ธ ๐ค๐ฌ๐ค | |
๐๏ธ๐ANY_CHARACTER๐ก โฌ ๏ธ ๐คโช๐ค | |
๐๏ธ๐INPUT_START๐ก โฌ ๏ธ ๐ค๐๐ค | |
๐๏ธ๐INPUT_END๐ก โฌ ๏ธ ๐ค๐๐ค | |
๐๏ธ๐ESCAPE๐ก โฌ ๏ธ ๐คโโ๐ค | |
๐๏ธ๐CLASS_WORD_ID๐ก โฌ ๏ธ ๐ค๐ก๐ค | |
๐๏ธ๐CLASS_WORD๐จ๐๐ก๐ โฌ ๏ธ ๐ถ๐คabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ๐คโ | |
๐๏ธ๐CLASS_DIGIT_ID๐ก โฌ ๏ธ ๐ค๐ข๐ค | |
๐๏ธ๐CLASS_DIGIT๐จ๐๐ก๐ โฌ ๏ธ ๐ถ๐ค0123456789๐คโ | |
๐๏ธ๐CLASS_WHITESPACE_ID๐ก โฌ ๏ธ ๐คโซ๐ค | |
๐๏ธ๐CLASS_WHITESPACE๐จ๐๐ก๐ โฌ ๏ธ ๐ถ๐ค โrโnโt๐คโ | |
๐๏ธ๐SPECIAL_CHARS๐จ๐๐ก๐ | |
๐ ๐ | |
๐ฟ | |
OPEN_SET | |
CLOSE_SET | |
OPEN_GROUP | |
CLOSE_GROUP | |
ALTERNATE | |
ZERO_TO_MANY | |
ONE_TO_MANY | |
ZERO_OR_ONE | |
ANY_CHARACTER | |
INPUT_START | |
INPUT_END | |
ESCAPE | |
๐ โก๏ธ ๐๏ธSPECIAL_CHARS | |
๐ | |
๐ finds the first occurrence of the specified pattern in the specified string ๐ | |
โ๐ pattern๐ก string๐ก โก๏ธ ๐ผ๏ธ ๐ | |
๐ถpatternโ โก๏ธ ๐๏ธ๐patternChars | |
๐ถstringโ โก๏ธ stringChars | |
๐stringCharsโ โก๏ธ stringLength | |
0 โก๏ธ ๐๏ธ๐matchPosition | |
stringLength โ 1 โก๏ธ ๐๏ธ๐maxMatchPosition | |
โช๏ธ ๐ฝpatternChars 0โ ๐ INPUT_START ๐ | |
0 โก๏ธ ๐๏ธmaxMatchPosition | |
๐จpatternChars 0โ | |
๐ | |
๐ | |
matchPosition โ๏ธ๐ maxMatchPosition ๐ค | |
matchPosition โ๏ธ stringLength | |
๐ | |
๐ช๐ stringChars matchPosition ๐คท โ โก๏ธ substringChars | |
๐๏ธ๐ patternChars substringChars 0 โ โก๏ธ result | |
โช๏ธ ๐resultโ ๐ | |
โฉ๏ธ ๐๐ผ๏ธ ๐ matchPosition ๐บ๐resultโ โ | |
๐ | |
matchPosition โฌ ๏ธโ 1 | |
๐ | |
โฉ๏ธ ๐๐ผ๏ธ ๐ ๐คท ๐คท โ | |
๐ | |
๐ | |
Matches the specified pattern at the start of the specified string | |
matchLength: the length of the match prior to this match | |
๐ | |
โ๐๏ธ pattern๐จ๐๐ก๐ string๐จ๐๐ก๐ matchLength๐ข โก๏ธ ๐ผ๏ธ ๐ | |
โช๏ธ ๐patternโ ๐ 0 ๐ | |
โฉ๏ธ ๐๐ผ๏ธ ๐ 0 matchLength โ | |
๐ ๐ โช๏ธ ๐ฝpattern 0โ ๐ INPUT_END ๐ | |
โช๏ธ ๐stringโ ๐ 0 ๐ | |
โฉ๏ธ ๐๐ผ๏ธ ๐ 0 matchLength โ | |
๐ ๐ ๐ | |
โฉ๏ธ ๐๐ผ๏ธ ๐ ๐คท ๐คท โ | |
๐ | |
๐ ๐ โช๏ธ ๐stringโ ๐ 0 ๐ | |
โฉ๏ธ ๐๐ผ๏ธ ๐ ๐คท ๐คท โ | |
๐ | |
๐บ๐ซ๐ pattern โ โก๏ธ result | |
๐ฝresult 0โ โก๏ธ head | |
๐ฝresult 1โ โก๏ธ operatorArray | |
๐ค๐ค โก๏ธ ๐๏ธ๐operator | |
โช๏ธ โ๐operatorArrayโ ๐ 0โ ๐ | |
๐ฝoperatorArray 0โ โก๏ธ ๐๏ธoperator | |
๐ | |
๐ฝresult 2โ โก๏ธ rest | |
โช๏ธ operator ๐ ZERO_TO_MANY ๐ | |
โฉ๏ธ ๐๐ pattern string matchLength 0 ๐คทโ | |
๐ ๐ โช๏ธ operator ๐ ONE_TO_MANY ๐ | |
โฉ๏ธ ๐๐ pattern string matchLength 1 ๐คทโ | |
๐ ๐ โช๏ธ operator ๐ ZERO_OR_ONE ๐ | |
โฉ๏ธ ๐๐ pattern string matchLength 0 1โ | |
๐ ๐ โช๏ธ ๐๐ headโ ๐ | |
โฉ๏ธ ๐๐ pattern string matchLengthโ | |
๐ ๐ โช๏ธ ๐ผ๐ headโ ๐ | |
๐ผ๐pattern stringโ โก๏ธ unitMatches | |
โช๏ธ unitMatches ๐ | |
โฉ๏ธ ๐๏ธ๐ rest ๐ช๐ string 1 ๐คทโ matchLength โ 1โ | |
๐ | |
๐ | |
โฉ๏ธ ๐๐ผ๏ธ ๐ ๐คท ๐คทโ | |
๐ | |
๐ | |
Matches the specified pattern multiple times at the start of the specified string | |
matchLength: the length of the match prior to this match | |
minMatches: the minimum number of matches to allow | |
maxMatches: the maximum number of matches to allow (inclusive) | |
๐ | |
โ๐ pattern๐จ๐๐ก๐ string๐จ๐๐ก๐ matchLength๐ข minMatches๐ข maxMatches๐ฌ๐ข โก๏ธ ๐ผ๏ธ ๐ | |
๐บ๐ซ๐ pattern โ โก๏ธ splitPattern | |
๐ฝsplitPattern 0โ โก๏ธ head | |
๐ฝsplitPattern 2โ โก๏ธ rest | |
0 โก๏ธ ๐๏ธ๐matchedTimes | |
๐ โก๏ธ ๐๏ธ๐discoveryDone | |
๐ | |
โdiscoveryDoneโ ๐ค | |
matchedTimes โ๏ธ ๐stringโ ๐ค | |
๐ค | |
maxMatches ๐ ๐คท ๐ | |
matchedTimes โ๏ธ ๐บmaxMatches | |
๐ค | |
๐ | |
๐๐head matchedTimesโ1โ โก๏ธ patternRepeated | |
๐๏ธ๐ patternRepeated string matchLengthโ โก๏ธ result | |
โช๏ธ ๐resultโ ๐ | |
matchedTimes โฌ ๏ธโ 1 | |
๐ ๐ ๐ | |
๐ โก๏ธ ๐๏ธdiscoveryDone | |
๐ | |
๐ | |
๐ matchedTimes โถ๏ธ๐ minMatches ๐ | |
๐๐head matchedTimesโ โก๏ธ patternRepeated | |
๐๏ธ๐ ๐ช๐๐ฟpatternRepeated rest๐โ string matchLengthโ โก๏ธ result | |
โช๏ธ ๐resultโ ๐ | |
โฉ๏ธ ๐๐ผ๏ธ ๐ 0 matchLengthโ | |
๐ | |
matchedTimes โฌ ๏ธโ 1 | |
๐ | |
โฉ๏ธ ๐๐ผ๏ธ ๐ ๐คท ๐คท โ | |
๐ | |
๐ Joins multiple character arrays into a single character array ๐ | |
โ๐ช strings๐จ๐๐จ๐๐ก๐๐ โก๏ธ ๐จ๐๐ก๐ ๐ | |
๐๐ โ โก๏ธ builder | |
๐string strings๐ | |
๐char string๐ | |
๐ปbuilder charโ | |
๐ | |
๐ | |
๐กbuilderโ โก๏ธ fullString | |
โฉ๏ธ ๐ถfullStringโ | |
๐ | |
๐ Splits a pattern into a head, operator, and the remainder ๐ | |
โ๐ซ pattern๐จ๐๐ก๐ โก๏ธ ๐จ๐๐จ๐๐ก๐๐ ๐ง๐ง ๐ | |
๐๐จ๐๐ก๐โ โก๏ธ ๐๏ธ๐head | |
๐๐จ๐๐ก๐โ โก๏ธ ๐๏ธ๐operator | |
๐๐จ๐๐ก๐โ โก๏ธ ๐๏ธ๐rest | |
-1 โก๏ธ ๐๏ธ๐restStartPosition | |
๐ฝpattern 0โ โก๏ธ firstChar | |
โช๏ธ firstChar ๐ OPEN_SET ๐ | |
๐บ๐๐ pattern CLOSE_SETโ โ 1 โก๏ธ ๐๏ธrestStartPosition | |
๐ช๐pattern 0 restStartPositionโ โก๏ธ ๐๏ธhead | |
๐ ๐ โช๏ธ firstChar ๐ OPEN_GROUP ๐ | |
๐บ๐๐ pattern CLOSE_GROUPโ โ 1 โก๏ธ ๐๏ธrestStartPosition | |
๐ช๐pattern 0 restStartPositionโ โก๏ธ ๐๏ธhead | |
๐ ๐ โช๏ธ ๐ฝ๐ firstCharโ ๐ firstChar ๐ ANY_CHARACTER ๐ | |
1 โก๏ธ ๐๏ธrestStartPosition | |
๐ฟfirstChar๐ โก๏ธ ๐๏ธhead | |
๐ ๐ โช๏ธ firstChar ๐ ESCAPE ๐ | |
2 โก๏ธ ๐๏ธrestStartPosition | |
๐ช๐pattern 0 2โ โก๏ธ ๐๏ธhead | |
๐ ๐ ๐ | |
๐จ๐๐ง๐คUnrecognized start of expression: ๐งฒfirstChar๐งฒ๐คโ | |
๐ | |
โช๏ธ restStartPosition โ๏ธ ๐patternโ ๐ค ๐ท๐ ๐ฝpattern restStartPositionโ โ ๐ | |
๐ปoperator ๐ฝpattern restStartPositionโโ | |
restStartPosition โฌ ๏ธโ 1 | |
๐ | |
๐ช๐ pattern restStartPosition ๐คทโ โก๏ธ ๐๏ธrest | |
โฉ๏ธ ๐ฟ head operator rest ๐ | |
๐ | |
๐ returns whether the character is an operator ๐ | |
โ๐ท char๐ก โก๏ธ ๐ ๐ | |
โฉ๏ธ โchar ๐ ๐ค๐คโ ๐ค ๐ฆ๐ฟ ZERO_OR_ONE ONE_TO_MANY ZERO_TO_MANY ๐ charโ | |
๐ | |
๐ Returns whether the pattern is a single "unit" ๐ | |
โ๐ผ pattern๐จ๐๐ก๐ โก๏ธ ๐ ๐ | |
โช๏ธ ๐patternโ ๐ 0 ๐ | |
โฉ๏ธ ๐ | |
๐ | |
๐ฝpattern 0โ โก๏ธ firstChar | |
โฉ๏ธ ๐ฝ๐firstCharโ ๐ | |
๐ฆ๐patternโ ๐ | |
firstChar ๐ ANY_CHARACTER ๐ | |
๐งฏ๐patternโ | |
๐ | |
๐ Matches the "unit" at the start of the string ๐ | |
โ๐ผ pattern๐จ๐๐ก๐ string๐จ๐๐ก๐ โก๏ธ ๐ ๐ | |
๐บ๐ซ๐ patternโ โก๏ธ parts | |
๐ฝparts 0โ โก๏ธ head | |
๐ฝhead 0โ โก๏ธ firstChar | |
โช๏ธ firstChar ๐ ANY_CHARACTER ๐ | |
โฉ๏ธ ๐stringโ โถ๏ธ 0 | |
๐ ๐ โช๏ธ ๐ฝ๐firstCharโ ๐ | |
โฉ๏ธ firstChar ๐ ๐ฝstring 0โ | |
๐ ๐ โช๏ธ ๐งฏ๐headโ ๐ | |
โฉ๏ธ ๐บ๐งฏ๐head stringโ | |
๐ ๐ โช๏ธ ๐ฆ๐headโ ๐ | |
โฉ๏ธ ๐ฆ๐head stringโ | |
๐ | |
โฉ๏ธ ๐ | |
๐ | |
๐ returns whether the pattern is a set ๐ | |
โ๐ฆ pattern๐จ๐๐ก๐ โก๏ธ ๐ ๐ | |
โฉ๏ธ ๐patternโ โถ๏ธ 0 ๐ค | |
๐ฝpattern 0โ ๐ OPEN_SET ๐ค | |
๐ฝpattern ๐patternโโ1โ ๐ CLOSE_SET | |
๐ | |
๐ returns whether the given set pattern matches at the start of the string ๐ | |
โ๐ฆ pattern๐จ๐๐ก๐ string๐จ๐๐ก๐ โก๏ธ ๐ ๐ | |
pattern โก๏ธ ๐๏ธ๐patternCopy | |
๐ญ remove first and last character in pattern (start and end set chars) | |
๐จpatternCopy 0โ | |
๐จpatternCopy ๐patternCopyโ โ 1โ | |
โฉ๏ธ ๐ฆpatternCopy ๐ฝstring 0โโ | |
๐ | |
๐ returns whether the character is a 'literal' (non-special) character ๐ | |
โ๐ฝ char๐ก โก๏ธ ๐ ๐ | |
โฉ๏ธ โchar ๐ ๐ค๐คโ ๐ค โ๐ฆSPECIAL_CHARS charโโ | |
๐ | |
๐ returns whether the pattern is an escape sequence ๐ | |
โ๐งฏ pattern๐จ๐๐ก๐ โก๏ธ ๐ ๐ | |
โฉ๏ธ ๐patternโ โถ๏ธ 0 ๐ค ๐ฝpattern 0โ ๐ ESCAPE | |
๐ | |
๐ | |
matches the specified escape sequence at the start of the string | |
throws an error if unrecognized escape sequence detected | |
๐ | |
โ๐งฏ pattern๐จ๐๐ก๐ string๐จ๐๐ก๐ โก๏ธ ๐ ๐ง๐ง ๐ | |
๐ฝpattern 1โ โก๏ธ escapeId | |
๐ฝstring 0โ โก๏ธ char | |
โช๏ธ escapeId ๐ CLASS_WORD_ID ๐ | |
โฉ๏ธ ๐ฆCLASS_WORD charโ | |
๐ ๐ โช๏ธ escapeId ๐ CLASS_DIGIT_ID ๐ | |
โฉ๏ธ ๐ฆCLASS_DIGIT charโ | |
๐ ๐ โช๏ธ escapeId ๐ CLASS_WHITESPACE_ID ๐ | |
โฉ๏ธ ๐ฆCLASS_WHITESPACE charโ | |
๐ ๐ โช๏ธ ๐ฆSPECIAL_CHARS escapeIdโ ๐ | |
โฉ๏ธ escapeId ๐ char | |
๐ | |
๐ก๐ patternโ โก๏ธ patternString | |
๐จ๐๐ง๐คUnrecognized escape sequence: ๐งฒpatternString๐งฒ๐คโ | |
๐ | |
๐ returns whether the pattern is an alternate expression ๐ | |
โ๐ pattern๐จ๐๐ก๐ โก๏ธ ๐ ๐ | |
โฉ๏ธ ๐patternโ โถ๏ธ 0 ๐ค | |
๐ฝpattern 0โ ๐ OPEN_GROUP ๐ค | |
๐ฝpattern ๐patternโโ1โ ๐ CLOSE_GROUP ๐ค | |
๐ฆpattern ALTERNATEโ | |
๐ | |
๐ matches the alternate expression at the start of the string ๐ | |
โ๐ pattern๐จ๐๐ก๐ string๐จ๐๐ก๐ matchLength๐ข โก๏ธ ๐ผ๏ธ ๐ | |
๐บ๐ซ๐patternโ โก๏ธ split | |
๐ฝsplit 0โ โก๏ธ head | |
๐ฝsplit 2โ โก๏ธ rest | |
โ๏ธ๐headโ โก๏ธ options | |
๐ option options ๐ | |
๐๏ธ๐ ๐ช๐๐ฟoption rest๐โ string matchLength โ โก๏ธ result | |
โช๏ธ ๐resultโ ๐ | |
โฉ๏ธ ๐๐ผ๏ธ ๐ 0 ๐resultโ โ | |
๐ | |
๐ | |
โฉ๏ธ ๐๐ผ๏ธ ๐ ๐คท ๐คทโ | |
๐ | |
๐ splits all alternates in the expression into their own character array ๐ | |
โโ๏ธ pattern๐จ๐๐ก๐ โก๏ธ ๐จ๐๐จ๐๐ก๐๐ ๐ | |
๐ช๐ pattern 1 ๐patternโโ2 โ โก๏ธ slice | |
๐ก๐ sliceโ โก๏ธ substring | |
๐ซsubstring ALTERNATEโ โก๏ธ alternateStrings | |
โฉ๏ธ ๐ฐalternateStrings ๐ alternateString๐ก โก๏ธ ๐จ๐๐ก๐ | |
โฉ๏ธ ๐ถalternateStringโ | |
๐โ | |
๐ | |
๐ converts a char array into a string ๐ | |
โ๐ก charArray๐จ๐๐ก๐ โก๏ธ ๐ก ๐ | |
๐๐ โ โก๏ธ builder | |
๐ char charArray ๐ | |
๐ปbuilder charโ | |
๐ | |
โฉ๏ธ ๐กbuilderโ | |
๐ | |
๐ Duplicates the char array multiple times into a single array ๐ | |
โ๐ string๐จ๐๐ก๐ times๐ข โก๏ธ ๐จ๐๐ก๐ ๐ | |
๐๐จ๐๐จ๐๐ก๐๐โ โก๏ธ ๐๏ธ๐strings | |
๐ i ๐โฉ 0 times 1โ ๐ | |
๐ปstrings stringโ | |
๐ | |
โฉ๏ธ ๐ช๐stringsโ | |
๐ | |
๐ญ TODO: contribute this back to Emojicode repository (array slice) | |
๐ Returns a new list consisting of length elements beginning from the element at index from in this list. Complexity: O(n). ๐ | |
โ๐ช list๐จ๐๐ก๐ from๐ข length๐ฌ๐ข โก๏ธ ๐จ๐๐ก๐ ๐ | |
๐listโ โก๏ธ ๐๏ธ๐end | |
โช๏ธ โ length ๐ ๐คท โ ๐ค from โ ๐บlength โ๏ธ ๐listโ ๐ | |
from โ ๐บlength โก๏ธ ๐๏ธend | |
๐ | |
๐๐จ๐๐ก๐โถ๏ธ๐ด end โ from โ โก๏ธ ๐๏ธ๐output | |
๐ i ๐โฉ from end 1 โ ๐ | |
๐ปoutput ๐ฝlist iโโ | |
๐ | |
โฉ๏ธ output | |
๐ | |
๐ญ TODO: contribute this back to Emojicode repository (array indexOf) | |
๐ | |
Finds the first occurrences of element in this list. Search is performed in list order. | |
Returns the index of the first occurrence or no value if search does not occur. | |
๐ | |
โ๐ list๐จ๐๐ก๐ search๐ก โก๏ธ ๐ฌ๐ข ๐ | |
0 โก๏ธ ๐๏ธ๐ index | |
๐ element list ๐ | |
โช๏ธ element ๐ search ๐ | |
โฉ๏ธ index | |
๐ | |
index โฌ ๏ธโ 1 | |
๐ | |
โฉ๏ธ ๐คท | |
๐ | |
๐ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
๐ฆ testtube ๐ | |
๐ ๐คregex.๐๐ค | |
๐ โก๏ธ ๐ข ๐ | |
โฉ๏ธ ๐๐๐งโ๐ฌโ๏ธโ๏ธ | |
๐ | |
๐ ๐งโ๐ฌ ๐งช ๐ | |
โ๏ธ โ๏ธ ๐ ๐ | |
๐๐ญโ โก๏ธ regex | |
๐ญ NO MATCH | |
โ๐ | |
๐๐regex ๐คabc๐ค ๐คcba๐คโโ | |
๐คliteral pattern should not match the reversed string๐ค | |
โ | |
โ๐ | |
๐ฝ๐regex ๐คabc๐ค ๐คcba๐คโโ ๐ ๐คท | |
๐คmatch failure should have no value for match index๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คabc๐ค ๐คcba๐คโโ ๐ ๐คท | |
๐คmatch failure should have no value for match length๐ค | |
โ | |
๐ญ LITERAL PATTERN - FULL STRING MATCH | |
โ๐ | |
๐๐regex ๐คabc๐ค ๐คabc๐คโโ | |
๐คliteral pattern should match the exact string๐ค | |
โ | |
๐ข๐ | |
๐บ๐ฝ๐regex ๐คabc๐ค ๐คabc๐คโโ | |
0 | |
๐คliteral pattern should be found at the correct index๐ค | |
โ | |
๐ข๐ | |
๐บ๐๐regex ๐คabc๐ค ๐คabc๐คโโ | |
3 | |
๐คliteral pattern should be have correct match length๐ค | |
โ | |
๐ญ LITERAL PATTERN - SUBSTRING MATCH | |
โ๐ | |
๐๐regex ๐คabc๐ค ๐ค abc ๐คโโ | |
๐คliteral substring pattern should match the exact string at any position๐ค | |
โ | |
๐ข๐ | |
๐บ๐ฝ๐regex ๐คabc๐ค ๐ค abc ๐คโโ | |
5 | |
๐คliteral substring pattern should be found at the correct index๐ค | |
โ | |
๐ข๐ | |
๐บ๐๐regex ๐คabc๐ค ๐ค abc ๐คโโ | |
3 | |
๐คliteral substring pattern should be have correct match length๐ค | |
โ | |
๐ญ PREFIX MATCH (๐) | |
โ๐ | |
๐๐regex ๐ค๐abc๐ค ๐คabc ๐คโโ | |
๐คprefix pattern should match the string starting with that pattern๐ค | |
โ | |
โ๐ | |
๐๐regex ๐ค๐abc๐ค ๐ค abc ๐คโโ | |
๐คprefix pattern should not match if string does not start with that pattern๐ค | |
โ | |
๐ข๐ | |
๐บ๐ฝ๐regex ๐ค๐abc๐ค ๐คabc ๐คโโ | |
0 | |
๐คprefix pattern should be found at the correct index๐ค | |
โ | |
๐ข๐ | |
๐บ๐๐regex ๐ค๐abc๐ค ๐คabc ๐คโโ | |
3 | |
๐คprefix pattern should be have correct match length๐ค | |
โ | |
๐ญ SUFFIX MATCH (๐) | |
โ๐ | |
๐๐regex ๐คabc๐๐ค ๐ค abc๐คโโ | |
๐คsuffix pattern should match the string ending with that pattern๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คabc๐๐ค ๐ค abc ๐คโโ | |
๐คsuffix pattern should not match if string does not end with that pattern๐ค | |
โ | |
๐ข๐ | |
๐บ๐ฝ๐regex ๐คabc๐๐ค ๐ค abc๐คโโ | |
5 | |
๐คsuffix pattern should be found at the correct index๐ค | |
โ | |
๐ข๐ | |
๐บ๐๐regex ๐คabc๐๐ค ๐ค abc๐คโโ | |
3 | |
๐คsuffix pattern should be have correct match length๐ค | |
โ | |
๐ญ ZERO OR ONE / OPTIONAL (๐ฌ) | |
โ๐ | |
๐๐regex ๐คab๐ฌc๐ค ๐คabc๐คโโ | |
๐คoptional pattern should match the string with that pattern๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คab๐ฌc๐ค ๐คac๐คโโ | |
๐คoptional pattern should match the string without that pattern๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คab๐ฌc๐ค ๐คabbc๐คโโ | |
๐คoptional pattern should not match if string has too many of the optional๐ค | |
โ | |
๐ญ ZERO OR MORE (๐) | |
โ๐ | |
๐๐regex ๐คab๐c๐ค ๐คabc๐คโโ | |
๐คzero or more pattern should match the string with that pattern๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คab๐c๐ค ๐คac๐คโโ | |
๐คzero or more pattern should match the string without that pattern๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คab๐c๐ค ๐คabbbbbbbbbbbbbbbbbbbbbc๐คโโ | |
๐คzero or more pattern should match if string has multiple of the optional๐ค | |
โ | |
๐ญ ONE OR MORE (๐บ) | |
โ๐ | |
๐๐regex ๐คab๐บc๐ค ๐คabc๐คโโ | |
๐คone or more pattern should match the string with that pattern๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คab๐บc๐ค ๐คac๐คโโ | |
๐คone or more pattern should not match the string without that pattern๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คab๐บc๐ค ๐คabbbbbbbbbbbbbbbbbbbbbc๐คโโ | |
๐คone or more pattern should match if string has multiple of the optional๐ค | |
โ | |
๐ญ SETS (๐ฟABC๐) | |
โ๐ | |
๐๐regex ๐คa๐ฟABC๐c๐ค ๐คaAc๐คโโ | |
๐คset pattern should match the string with any unit in the set๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คa๐ฟABC๐c๐ค ๐คaBc๐คโโ | |
๐คset pattern should match the string with any unit in the set๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คa๐ฟABC๐c๐ค ๐คaCc๐คโโ | |
๐คset pattern should match the string with any unit in the set๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คa๐ฟABC๐c๐ค ๐คac๐คโโ | |
๐คset pattern should not match the string without a unit from the set๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คa๐ฟABC๐c๐ค ๐คaDc๐คโโ | |
๐คset pattern should not match the string with a unit not in the set๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คa๐ฟABC๐c๐ค ๐คaAAAAAAAAAAAc๐คโโ | |
๐คset pattern should not match if string has multiple of the set unit๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คa๐ฟABC๐c๐ค ๐คaABCc๐คโโ | |
๐คset pattern should not match if string has multiple of the set unit๐ค | |
โ | |
๐ญ ALTERNATES (๐คAB๐C๐ค) | |
โ๐ | |
๐๐regex ๐คa๐คAB๐C๐คc๐ค ๐คaABc๐คโโ | |
๐คalternate pattern should match the string with any pattern in the alternate list๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คa๐คAB๐C๐คc๐ค ๐คaCc๐คโโ | |
๐คalternate pattern should match the string with any pattern in the alternate list๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คa๐คAB๐C๐คc๐ค ๐คac๐คโโ | |
๐คalternate pattern should not match the string without a pattern from the alternate list๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คa๐คAB๐C๐คc๐ค ๐คaAc๐คโโ | |
๐คalternate pattern should not match the string with a pattern not in the alternate list๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คa๐คAB๐C๐คc๐ค ๐คaCCCCCCCCCCc๐คโโ | |
๐คalternate pattern should not match if string has multiple of the alternate list๐ค | |
โ | |
โ๐ | |
๐๐regex ๐คa๐คAB๐C๐คc๐ค ๐คaABCc๐คโโ | |
๐คalternate pattern should not match if string has multiple of the alternate list๐ค | |
โ | |
๐ญ ANY CHARACTER (โช) | |
๐ char ๐ถ | |
๐คb ๐ช0๐~๐ค | |
โ ๐ | |
โ๐ | |
๐๐regex ๐คaโชc๐ค ๐คa๐งฒchar๐งฒc๐คโโ | |
๐คany character token should match any character (๐งฒchar๐งฒ)๐ค | |
โ | |
๐ | |
โ๐ | |
๐๐regex ๐คaโชc๐ค ๐คac๐คโโ | |
๐คany character token should not match no character๐ค | |
โ | |
๐ญ ESCAPE (โ) | |
๐ char ๐ถ | |
๐ค๐ฟ๐๐ค๐ค๐๐๐บ๐ฌโช๐๐โโ๐ค | |
โ ๐ | |
โ๐ | |
๐๐regex ๐คaโโ๐งฒchar๐งฒc๐ค ๐คa๐งฒchar๐งฒc๐คโโ | |
๐คa pattern escaping a special character should match that literal character (๐งฒchar๐งฒ)๐ค | |
โ | |
๐ | |
๐ญ๐ | |
๐ญ ๐ญ TODO: There isn't a way to test this since I declared it not-error-prone. When I refactor, I will need to make sure this test case works as expected. | |
๐ญ ๐ โก๏ธ โช ๐ง๐ง | |
๐ญ โฉ๏ธ ๐regex ๐คaโโ c๐ค ๐คa c๐คโ | |
๐ญ ๐ โก๏ธ invalidCall | |
๐ญ ๐ โ๏ธinvalidCallโ ๐ | |
๐ญ ๐๐ ๐คproviding an invalid escape sequence should throw an error๐ค โ | |
๐ญ ๐ ๐ error ๐ | |
๐ญ โ ๐ ๐คproviding an invalid escape sequence should throw an error๐ค โ | |
๐ญ ๐ | |
๐๐ญ | |
๐ญ WORD CHARACTER CLASS (โ๐ก) | |
๐ char ๐ถ | |
๐คabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ๐ค | |
โ ๐ | |
โ๐ | |
๐๐regex ๐คaโโ๐กc๐ค ๐คa๐งฒchar๐งฒc๐คโโ | |
๐คa pattern including a word character escape sequence should allow any word character (๐งฒchar๐งฒ)๐ค | |
โ | |
๐ | |
๐ char ๐ถ | |
๐ค0123456789 โtโrโn~๐๐ช,.-๐ค | |
โ ๐ | |
โ๐ | |
๐๐regex ๐คaโโ๐กc๐ค ๐คa๐งฒchar๐งฒc๐คโโ | |
๐คa pattern including a word character escape sequence should not allow a character not included in the class (๐งฒchar๐งฒ)๐ค | |
โ | |
๐ | |
๐ญ DIGIT CHARACTER CLASS (โ๐ข) | |
๐ char ๐ถ | |
๐ค0123456789๐ค | |
โ ๐ | |
โ๐ | |
๐๐regex ๐คaโโ๐ขc๐ค ๐คa๐งฒchar๐งฒc๐คโโ | |
๐คa pattern including a digit character escape sequence should allow any digit character (๐งฒchar๐งฒ)๐ค | |
โ | |
๐ | |
๐ char ๐ถ | |
๐คabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ โtโrโn~๐๐ช,.-๐ค | |
โ ๐ | |
โ๐ | |
๐๐regex ๐คaโโ๐ขc๐ค ๐คa๐งฒchar๐งฒc๐คโโ | |
๐คa pattern including a digit character escape sequence should not allow a character not included in the class (๐งฒchar๐งฒ)๐ค | |
โ | |
๐ | |
๐ญ WHITESPACE CHARACTER CLASS (โโซ) | |
๐ char ๐ถ | |
๐ค โrโnโt๐ค | |
โ ๐ | |
โ๐ | |
๐๐regex ๐คaโโโซc๐ค ๐คa๐งฒchar๐งฒc๐คโโ | |
๐คa pattern including a digit character escape sequence should allow any digit character (๐งฒchar๐งฒ)๐ค | |
โ | |
๐ | |
๐ char ๐ถ | |
๐คabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~๐๐ช,.-๐ค | |
โ ๐ | |
โ๐ | |
๐๐regex ๐คaโโโซc๐ค ๐คa๐งฒchar๐งฒc๐คโโ | |
๐คa pattern including a digit character escape sequence should not allow a character not included in the class (๐งฒchar๐งฒ)๐ค | |
โ | |
๐ | |
๐ญ TORTURE TEST | |
๐ค๐he๐คโโ๐ก๐โโ๐ข๐โโ๐๐ค๐o a๐คcat๐dog๐ค๐บโโโซ๐ฌb๐บR๐โโ๐กโโ๐ข๐บโโ๐๐ฟ0123๐โช๐AAA๐๐ค โก๏ธ pattern | |
๐คhe๐0eo adogcatdogdog bbbbbbbbbbbbj009๐2~~AAA๐ค โก๏ธ string | |
๐regex pattern stringโ โก๏ธ result | |
โ๐ ๐resultโ ๐คtorture test pattern/input should match๐คโ | |
๐ | |
๐ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A HUGE thanks to "clumsy computer" on YouTube for his live-stream implementation of a regex engine in Python. I gained the understanding, coded along with him in TypeScript, got it working the way I wanted to, then translated it into EmojiCode.