Lea Verou on Regular Expressions
Regular expressions are a very powerful thing and a lot of junior developers struggle to wrap their heads around it and remember the syntax.
VerEx() .startOfLine() .then('http') .maybe('s') .then('://') .maybe('www.') .anythingBut(' ') .endOfLine();
The above code will compile into this RegExp:
On Thursdays we post videos that we believe are worth watching and that can make you a better front-end developer. Have such a video to share? Share with us
P.S. Remember, never try to parse html with regular expressions!