<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Choi Changhwan</title>
    <description>The latest articles on DEV Community by Choi Changhwan (@choi_changhwan_a8cf9f164f).</description>
    <link>https://dev.to/choi_changhwan_a8cf9f164f</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4012911%2F6d410a47-ebf6-4689-8274-8e6455c57b36.png</url>
      <title>DEV Community: Choi Changhwan</title>
      <link>https://dev.to/choi_changhwan_a8cf9f164f</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/choi_changhwan_a8cf9f164f"/>
    <language>en</language>
    <item>
      <title>Stop validating emails with regex: here's what to do instead</title>
      <dc:creator>Choi Changhwan</dc:creator>
      <pubDate>Wed, 08 Jul 2026 02:40:36 +0000</pubDate>
      <link>https://dev.to/choi_changhwan_a8cf9f164f/stop-validating-emails-with-regex-heres-what-to-do-instead-45ci</link>
      <guid>https://dev.to/choi_changhwan_a8cf9f164f/stop-validating-emails-with-regex-heres-what-to-do-instead-45ci</guid>
      <description>&lt;p&gt;Almost every codebase I've touched has some version of this line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ok&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sr"&gt;/^&lt;/span&gt;&lt;span class="se"&gt;[^&lt;/span&gt;&lt;span class="sr"&gt;@&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;+@&lt;/span&gt;&lt;span class="se"&gt;[^&lt;/span&gt;&lt;span class="sr"&gt;@&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;+&lt;/span&gt;&lt;span class="se"&gt;\.[^&lt;/span&gt;&lt;span class="sr"&gt;@&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;+$/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It feels like email validation. It isn't. Here's what that regex actually misses, and a more honest way to check an address before you trust it.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Regex only checks &lt;em&gt;shape&lt;/em&gt;, not reality
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;a@a.a&lt;/code&gt; passes most regexes. So does &lt;code&gt;test@mailinator.com&lt;/code&gt; (a disposable address) and &lt;code&gt;ceo@yourcompany.com&lt;/code&gt; typed as &lt;code&gt;ceo@yourcompnay.com&lt;/code&gt;. Your regex says "valid" to all three. Your signup funnel, your transactional email, and your deliverability rate disagree.&lt;/p&gt;

&lt;p&gt;The full RFC 5322 grammar for a valid address is famously monstrous, and even the correct version tells you nothing about whether mail will actually arrive.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The four checks that actually matter
&lt;/h2&gt;

&lt;p&gt;Instead of one regex, think in layers, cheapest first:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Syntax&lt;/strong&gt; — a &lt;em&gt;sane&lt;/em&gt; subset, not the full RFC. Catch the obvious garbage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disposable / role detection&lt;/strong&gt; — is the domain a throwaway (&lt;code&gt;mailinator.com&lt;/code&gt;, &lt;code&gt;10minutemail&lt;/code&gt;) or a role inbox (&lt;code&gt;admin@&lt;/code&gt;, &lt;code&gt;support@&lt;/code&gt;)? These wreck your engagement metrics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Typo suggestions&lt;/strong&gt; — &lt;code&gt;gmial.com&lt;/code&gt; to &lt;code&gt;gmail.com&lt;/code&gt;, &lt;code&gt;yaho.com&lt;/code&gt; to &lt;code&gt;yahoo.com&lt;/code&gt;. One of the highest-ROI fixes for signup conversion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MX / deliverability&lt;/strong&gt; — does the domain actually publish mail servers (MX records)? If there's no MX, nothing you send can ever land.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That last one is the step people skip, because it needs a DNS lookup rather than a string test.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Doing the MX check
&lt;/h2&gt;

&lt;p&gt;In Node you can do it yourself:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;promises&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;dns&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;node:dns&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;hasMx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;domain&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;records&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;dns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolveMx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;domain&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;records&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the core idea. In a browser or edge function you don't have raw DNS, so you'd hit a small endpoint that does the lookup for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. A hosted version, if you don't want to build it
&lt;/h2&gt;

&lt;p&gt;I got tired of re-implementing these four layers, so I put them behind one free GET call. Sharing in case it saves you the same afternoon:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET https://verify-api.cchkjjdobby.workers.dev/email?email=test@mailinator.com
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"domain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"mailinator.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"is_disposable"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"has_mx"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"disposable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"deliverable"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CORS is enabled and it runs on Cloudflare Workers with no paid external calls, so the free tier is genuinely free. There's a no-signup UI too if you just want to paste an address and see the layers: &lt;a href="https://tools-site.cchkjjdobby.workers.dev" rel="noopener noreferrer"&gt;https://tools-site.cchkjjdobby.workers.dev&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Honest limitations
&lt;/h2&gt;

&lt;p&gt;An MX check confirms the &lt;em&gt;domain&lt;/em&gt; can receive mail — it can't guarantee a specific &lt;em&gt;inbox&lt;/em&gt; exists without sending something. And you should never hard-block a signup on a typo guess; suggest, don't reject.&lt;/p&gt;

&lt;p&gt;That's the trade-off: cheap layered checks catch most bad addresses before they cost you, and you accept that the last mile (does this exact mailbox exist) needs an actual send.&lt;/p&gt;

&lt;p&gt;What does your stack do for this today — roll your own, or pay for a validation SaaS? Curious what the breaking point is where people decide to pay.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>javascript</category>
      <category>api</category>
    </item>
    <item>
      <title>I built free email, phone &amp; card validators + a tiny hosted API (with real MX deliverability)</title>
      <dc:creator>Choi Changhwan</dc:creator>
      <pubDate>Fri, 03 Jul 2026 02:02:47 +0000</pubDate>
      <link>https://dev.to/choi_changhwan_a8cf9f164f/i-built-free-email-phone-card-validators-a-tiny-hosted-api-with-real-mx-deliverability-4mkd</link>
      <guid>https://dev.to/choi_changhwan_a8cf9f164f/i-built-free-email-phone-card-validators-a-tiny-hosted-api-with-real-mx-deliverability-4mkd</guid>
      <description>&lt;p&gt;I kept needing the same small checks in side projects — is this email real, is this phone number formatted right, is this card number even valid — so I built a set of free tools and put the same logic behind a tiny hosted API. Sharing in case it saves someone else time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live tools (no signup):&lt;/strong&gt; &lt;a href="https://tools-site.cchkjjdobby.workers.dev" rel="noopener noreferrer"&gt;https://tools-site.cchkjjdobby.workers.dev&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Email&lt;/strong&gt; — syntax, disposable/role detection, typo suggestions (&lt;code&gt;gmial.com&lt;/code&gt; → &lt;code&gt;gmail.com&lt;/code&gt;), and a real &lt;strong&gt;MX-record deliverability&lt;/strong&gt; check (not just regex).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Phone&lt;/strong&gt; — E.164 formatting + country detection for 35+ countries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Card&lt;/strong&gt; — Luhn checksum + brand detection (Visa, Mastercard, Amex…). Format-level only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bonus&lt;/strong&gt; — an SEO/readability text analyzer (Flesch, reading time, keyword density) that also works on Korean.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Using the API
&lt;/h2&gt;

&lt;p&gt;One GET call, JSON back, CORS enabled:&lt;/p&gt;

&lt;p&gt;GET &lt;a href="https://verify-api.cchkjjdobby.workers.dev/email?email=test@mailinator.com" rel="noopener noreferrer"&gt;https://verify-api.cchkjjdobby.workers.dev/email?email=test@mailinator.com&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"domain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"mailinator.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"is_disposable"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"has_mx"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"disposable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"deliverable"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Docs: &lt;a href="https://tools-site.cchkjjdobby.workers.dev/docs" rel="noopener noreferrer"&gt;https://tools-site.cchkjjdobby.workers.dev/docs&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Honest limitations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Card check is &lt;strong&gt;format/Luhn/brand only&lt;/strong&gt; — it does not confirm a card is real or active.&lt;/li&gt;
&lt;li&gt;Phone validation is length/prefix-based, not carrier-level.&lt;/li&gt;
&lt;li&gt;The email MX check estimates deliverability; it can't guarantee an inbox exists.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It runs on Cloudflare Workers with no paid external calls, so the free tier is real and it stays fast.&lt;/p&gt;

&lt;p&gt;Would love feedback — especially: &lt;strong&gt;what would make something like this actually worth paying for in your stack?&lt;/strong&gt; That's the part I'm trying to figure out.&lt;/p&gt;

</description>
      <category>api</category>
      <category>showdev</category>
      <category>sideprojects</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
