FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Regex Cheat Sheet: 10 Patterns That Handle 90% of Real Work
NewsWeb Development

Regex Cheat Sheet: 10 Patterns That Handle 90% of Real Work

via Dev.to JavaScriptTextKit13h ago

I've been writing regex for years and I still look things up constantly. The problem with most cheat sheets is they list every possible syntax token without telling you which ones you'll actually use. Below are my working references, the patterns I reach for over and over. The six characters you need to know \d → any digit (0-9) \w → any word character (letter, digit, underscore) \s → any whitespace (space, tab, newline) \D → any NON-digit \W → any NON-word character \S → any NON-whitespace Uppercase = inverse. That's the whole pattern. Quantifiers + one or more * zero or more ? zero or one (optional) {3} exactly 3 {2,5} between 2 and 5 {3,} 3 or more The * vs + distinction matters: \d* matches an empty string (zero digits is fine). \d+ requires at least one digit. When in doubt, you want + . The 10 patterns I copy-paste the most 1. Email [\w.-]+@[\w.-]+\.\w{2,} Not RFC-perfect. Doesn't need to be. Handles real-world emails. const emails = text . match ( / [\w .- ] +@ [\w .- ] + \.\w{2

Continue reading on Dev.to JavaScript

Opens in a new tab

Read Full Article
6 views

Related Articles

Wiim Sound review: This smart speaker is so close to fully replacing my Sonos
News

Wiim Sound review: This smart speaker is so close to fully replacing my Sonos

ZDNet • 21m ago

Updated Test Article
News

Updated Test Article

Dev.to • 38m ago

Own a Sony TV? Changing these 3 settings will greatly improve its picture quality
News

Own a Sony TV? Changing these 3 settings will greatly improve its picture quality

ZDNet • 40m ago

News

Stop Using Switch Statements: Keyed Services in .NET — A Practical Approach

Medium Programming • 1h ago

Workers report watching Ray-Ban Meta-shot footage of people using the bathroom
News

Workers report watching Ray-Ban Meta-shot footage of people using the bathroom

Ars Technica • 2h ago

Discover More Articles