background effect
Foreground
Foreground
D0Z - motion / graphic / dev๐Ÿงบ
JavaScript Regular Expressionsโœ•

brain

Some files are private or not ready yet, if a link gives you a 404 that's why :)
This is a work in progress, new notes will be added daily

List of note Indexes

    
                .... |\| .|||.    |\/|  .|\\. .|.
              .\\||/|.  .\|..||  .\|..|||...||.....
            .|   .....||.|\\\\\\    ... |\\\/. .\\. .||
        .\\|   .|\\|..|\\ .\\\\  .\\|. .\\\\\|  |\| |\\|
        |\\  |\\|..  /\\\. |\|\\   \\\\|.   .|\\. .\\\\|
        .\\. |\\\\\\\|.. .\\|      .\\||\\/|. |\\|     .|/\|
      \. .\\\||/\|....   \\| |\/   |\\\  |\\\| .\\|  \\| ....
    |\/  |\\| |\\\\\\\| |\|.\\\   \\\\. |\\\\| |\\  \\.  ||..
      ..|||\|  .. .\\\\. |\\\\\\  .\\|....|\\\. |\\\\\\  |/. |/
    \\\|..   .\\\ |\\. .\\\| \\|   |||\\\.  ...|\\/||.  .\\\
  |\|  |\/.  /\\\\\| .\\\\. \\.   .../|.   .|\\\|.   |\\\|  |\\
    .  |||\\|.  ..||| .\\|.  |\|  \\|..../\\| |\\|  .\\\\\   ..
    \\|  .||\|.|..      |\\\|./\  \\||\. ||...    .\\\\/.  |\/||
    ..|/||.   |\\\\\|.     .|/\|  ||.        .||\\\     .|||. |\
  .\/|  \\\. .|\\\|||\\\||..       .|\\\\\\\|\\\\.  /\\\\||. |
    .|| |\\\\|  .......|\\\\\\.  .\\\. ..|||....  .\\\\|.. ...
    \\||....|\\\\\\\\||\\\\\\\/   |\|....|||\\\\\\\/....|\\\|
      ||.|\||\\| .....|\\\\..\\|    .|\\\. ||........ .|\|...
          . |\  /\\/\\\\\\. |\.  .\\\\\\.  ./\\\\/  |\\\||.
        .|\.|\| .|\|... ..              ./\\|..|\\|  ..
            .|\\|  .\\\\.\\\\\\\   \||...\\\|..|\\\|.||
                |\. ..||....||     ... ..||\\\. .|.
                        ...            .......

  

โ†‘ JavaScript | ๐Ÿ”’ Regular Expressions


JavaScript - Regular Expressions

in JavaScript ๐Ÿ”’ Regex are created using //

let string = 'This is a long string.'
let string2 = 'short string'
let regex = /This/
regex.test(string) // true
regex.test(string) // false

regex = /this/i // case insensitive
regex = /^this/ // "this" at the beggining of the string
regex = /this$/ // "this" at the end of the string
regex = /this./ // "this" + any character
regex = /this\./ // escaped so it will actually check for "this."
javascript

Regex bug

Calling regex.test() multiple times is bugged, especially when using a regex in a loop. To fix it set regex.lastIndex = 0 before each test.

See: es3-regexes-broken, tdlr: regex using /g doesn't have their regex.lastIndex reset.

ยฉ 2026 d0z.eu | 0.1.0-beta.41