📘RegExp
Regular Expressions
Regular expressions are string patterns and used with:
\w word character = [a-zA-Z0-9_]
\s whitespace By default, regular expressions work on code units, not actual characters❗
Characters that are composed of two code units (e.g. emojis) behave strangely.
• test if a string matches a regex: regex.test()
• find index position in the string: str.search()
• only want the first match: regex.exec() or str.match() with /g not set.
• return all matches: str.match()
• obtain capture groups (with /g set): regex.exec() or str.matchAll() ⭐️
creating regex
regex properties
pattern matching
✨ examples
Debuggex - to "see" regex.
RegExr ⭐️
Unicode Utilities: Character Properties
Last updated
Was this helpful?