guide2 min read

Regex for Beginners

Learn regular expressions from scratch. Covers basic syntax, common patterns, and practical examples.

Regular expressions match patterns in text. Start with literals: /hello/ matches the exact text "hello". Add character classes: /[aeiou]/ matches any vowel. Use quantifiers: /a+/ matches one or more a characters. Combine them: /[A-Z][a-z]+/ matches a capitalized word. The most useful patterns for beginners: \d (any digit), \w (any letter/digit/underscore), \s (any whitespace), . (any character), ^ (start of string), $ (end of string). Practice with the RegexQuick tester — paste a pattern and test string, see matches highlighted in real-time.