- 🚨 Watch this video tutorial! (this is technical info needed for the examples). Of course if you alreaddy know this material, you can skip.
- 🔢 This is found in a group, maybe pick just one to check out!
- 🍿 Additional video if you have a particular interest and want to do a deeper dive.
- 📕 Required reading! Let's make sure we all have read this.
- 📚 Optional additional reading for a deeper dive.
- 💻 Code examples here!
- 🔗 Extra reference material / link
- 📚 2016 Notes and Examples
- Regular Expression Video Tutorials
- 🚨 Intro to Regex - ~11 min
- 🚨 Meta-Characteres - ~16 min
- 🚨 Character Classes - ~14 min
- 🚨 Capturing Groups - ~13 min
- 🍿 Back References - ~4 min
- 🚨 test() and match() - ~17 min
- 🍿 exec() - ~7 min
- 🚨 split() - ~9 min
- 🍿 replace() - ~19 min
- 📕 Chapter 9: Regular Expressions from Eloquent JavaScript by Marijn Haverbeke.
- 📚 Introducing Regular Expressions: JavaScript and TypeScript by Jörg Krause. (This is the full book! If you prefer this to the videos I recommend chapters 1-3)
- 🔗 JavaScript Regex reference:
test()
,exec()
- 🔗 String:
match()
- 🔗 Splitting with regex:
split()
- 🔗 Replace with regex:
replace()
Design an exercise around regular expressions. Here are some ideas if you are feeling stuck! (To be clear, just do one thing, and writing code is not required for this assignment!)
- Experiment with using Regular Expressions in a text editor. What new powers does this unlock in your workflow? Write up a post documenting your experiments.
- Play an online Regular Expressions game like these two above or share any you find! Write up a post documenting your experience.
- Chop up a text into words using
split()
and rebuild the text as separate<span>
elements that you can interact with individually. Here is example code from this video. - Create a programmatic version of the algorithm you developed for the constrained writing exercise.
- The Flesch Index is a "reading level" score for a passage in English. Here is a p5 sketch that calculates the Flesch Index for a body of text. How could this be improved / changed with regular expressions?
- Create a mad libs generator. For reference here is a video about making Mad Libs with p5.js!
- Create a "word replacer" (all words that start with E to words that start with A, all fruits with vegetables, etc.)
In preparation for next week, add a link to a data source or API (even just data that appears in raw form on a web page) that interests you! Don't worry about this too much, anything will do! I'll use this list to prepare examples for next week.
- add a link to your API / data source here
- David Leyva -- GIPHY API
- Bowei Xu -- NASA
- Soojin Lee --YouTube
- Henry Wang -- Mushroom
- Nick Parisi --Pokemon
- Tarun Sharma - W/O api:Size of things and TV Quotes, With api:genius.com
- Shira -- Oxford Dictionaries
- Jeeyoon Hyun -- Screenshot API
- Suraj Barthy - Tumblr API
- Cheer Chen -- Street View Publish API
- Yonatan Rozin -- Web Bluetooth API
- Xiangrui Zeng -- Kanye West API
- Casta Zhu -- City Geo API
- Junoh Yu -- Tinder API
(Please note you are welcome to post under a pseudonym and/or password protect your published assignment. Here is some helpful information on privacy options for an NYU blog. Finally, if you prefer not to post your assignment at all here, you may email the submission.)
- Name -- [assignment title](assignment url)
- Shira -- horoscope RegEx
- David Leyva -- RegEx Quiz
- Nick Parisi --Regex Experiment and Game
- Tarun Sharma -- Chaotic Poetry
- Cheer Chen -- Regex practice
- Yonatan Rozin -- Programming with regular expressions
- Suraj Barthy -- \bRegex\b
- Xiangrui Zeng -- Regex Game
- Casta Zhu -- Regex Practice
- Bowei Xu -- Regex Practice
- Henry Wang -- Regex Time Poem
- Junoh Yu -- Regex Documentation
- David Currie -- live code css
- Jeeyoon Hyun -- Glyph Eraser
- Soojin Lee -- Regex Games & Exercises