Skip to content

Latest commit

 

History

History
31 lines (27 loc) · 2.16 KB

File metadata and controls

31 lines (27 loc) · 2.16 KB

Regex

How to write super simple (and useful) regular expressions for real world challenges 1/28/2021
Javascript regular expressions aren’t that daunting — here’s how to design your own 7/22
Regex cheatsheet 6/11
https://ihateregex.io/ 3/4
http://regexr.com/ 1/22
6 Handy Regular Expressions Every Front-End Developer Should Know 1/21
Regex with JavaScript 1/17/2020
Intro to Regex for Web Developers
Regex tutorial — A quick cheatsheet by examples

{% code title="Regex" %}

[^.!?] //matches any character that’s not a ., !, or ?
[1–9]  //matches a digit between 1 to 9.
*      //matches zero or more sequences of the preceding item
\b     //matches at a position known as a “word boundary” (a position that’s either followed or preceded by an ASCII letter, digit, or underscore).\b matches at a position known as a “word boundary” (a position that’s either followed or preceded by an ASCII letter, digit, or underscore).
\s     //matches a single whitespace character, including ASCII space, tab, line feed, carriage return, vertical tab, and form feed
.      //matches any character that’s not a line break character
+      //matches the previous item one or more times
?      //matches zero or one occurrence of the preceding item
g      //tells the regex engine to match all occurrences rather than stopping after the first match
i      //makes the search case-insensitive

str.match(//gi);

{% endcode %}