Course Info / Syllabus

Labs

Lecture Topics

Exam Reviews

Source Code & Other Resources


Operating Systems Concepts & Design

Regular expressions

A regular expression (regex for short) allow developers to match strings against a pattern, extract submatch information, or simply test if the string conforms to that pattern.

Usually such patterns are used by string-searching algorithms for “find” or “find and replace” operations on strings, or for input validation. - Wiki


🚩 The Basics: Characters & Anchors

Symbol Description Example
. Wildcard: Matches any single character except newline. b.t matches bat, bet, bit.
^ Start: Matches the beginning of a line. ^Hello matches “Hello world”.
$ End: Matches the end of a line. bye$ matches “See ya, bye”.
\ Escape: Lets you search for special characters like . or *. \.com matches “.com”.
` | ` OR: Matches the pattern on the left or the right.  

🔢 Quantifiers: “How many?”


📦 Character Classes & Shorthand

Shorthand Meaning Equivalent To
\d Any Digit [0-9]
\D Any Non-digit [^0-9]
\w Any Word character [a-zA-Z0-9_]
\W Any Non-word character (symbols, spaces, etc.)
\s Any Whitespace (space, tab, newline)
[abc] Set: Matches any char in brackets a, b, or c
[^abc] Negated Set: Matches anything except Everything but a, b, or c

Frequently Used Resources

Games

Examples in the Wild