<?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: Fábio Leal</title>
    <description>The latest articles on DEV Community by Fábio Leal (@fabiosleal).</description>
    <link>https://dev.to/fabiosleal</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F258382%2F87187d11-e53b-464b-894f-1ffbf84ec447.jpeg</url>
      <title>DEV Community: Fábio Leal</title>
      <link>https://dev.to/fabiosleal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fabiosleal"/>
    <language>en</language>
    <item>
      <title>How to Create the "Apple Liquid Glass" Effect with CSS and SVG</title>
      <dc:creator>Fábio Leal</dc:creator>
      <pubDate>Wed, 29 Oct 2025 18:58:55 +0000</pubDate>
      <link>https://dev.to/fabiosleal/how-to-create-the-apple-liquid-glass-effect-with-css-and-svg-2o06</link>
      <guid>https://dev.to/fabiosleal/how-to-create-the-apple-liquid-glass-effect-with-css-and-svg-2o06</guid>
      <description>&lt;p&gt;If you've been searching for the "Apple Liquid Glass" style, you're in the right place. You may already be familiar with traditional "glassmorphism," the popular design trend that uses backdrop-filter: blur() to create a frosted glass look.This article introduces the "Apple Liquid Glass" technique, a new way to achieve a more realistic and dynamic result. We'll break down how to create its signature rippling distortion using a clever combination of layered HTML elements, CSS, and a powerful SVG filter. We'll be referencing the code from the "Glassmorphism Music Player" example.&lt;/p&gt;

&lt;p&gt;The Core Concept: Stacking Layers&lt;/p&gt;

&lt;p&gt;The entire effect relies on stacking four distinct layers on top of each other using CSS positioning and z-index.&lt;/p&gt;

&lt;p&gt;Imagine it like a sandwich:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Content (Top Layer, z-index: 3) - Your text, images, and buttons.&lt;/li&gt;
&lt;li&gt;Specular Highlight (Middle Layer, z-index: 2) - A subtle inner border to catch the "light."&lt;/li&gt;
&lt;li&gt;Glass Overlay (Middle Layer, z-index: 1) - The semi-transparent background color.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Filter Layer (Bottom Layer, z-index: 0) - The magic layer that distorts everything behind it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The HTML Structure&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;First, you need a container for all these layers. Inside, you'll have the layers themselves, plus a final element for your actual content.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!-- The main container --&amp;gt;
&amp;lt;div class="glass-container"&amp;gt;

  &amp;lt;!-- Layer 4: The Distortion Filter --&amp;gt;
  &amp;lt;div class="glass-filter"&amp;gt;&amp;lt;/div&amp;gt;

  &amp;lt;!-- Layer 3: The Semi-Transparent Background --&amp;gt;
  &amp;lt;div class="glass-overlay"&amp;gt;&amp;lt;/div&amp;gt;

  &amp;lt;!-- Layer 2: The "Light" Highlight --&amp;gt;
  &amp;lt;div class="glass-specular"&amp;gt;&amp;lt;/div&amp;gt;

  &amp;lt;!-- Layer 1: Your Content --&amp;gt;
  &amp;lt;div class="glass-content"&amp;gt;
    &amp;lt;!-- Your player, text, etc. goes here --&amp;gt;
  &amp;lt;/div&amp;gt;

&amp;lt;/div&amp;gt;

&amp;lt;!-- 
  The SVG Filter Definition 
  (Place this anywhere in your HTML, 
  often at the bottom of the &amp;lt;body&amp;gt;)
--&amp;gt;
&amp;lt;svg style="display: none"&amp;gt;
  &amp;lt;filter id="lg-dist" x="0%" y="0%" width="100%" height="100%"&amp;gt;
    &amp;lt;feTurbulence
      type="fractalNoise"
      baseFrequency="0.008 0.008"
      numOctaves="2"
      seed="92"
      result="noise"
    /&amp;gt;
    &amp;lt;feGaussianBlur in="noise" stdDeviation="2" result="blurred" /&amp;gt;
    &amp;lt;feDisplacementMap
      in="SourceGraphic"
      in2="blurred"
      scale="70"
      xChannelSelector="R"
      yChannelSelector="G"
    /&amp;gt;
  &amp;lt;/filter&amp;gt;
&amp;lt;/svg&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;The CSS Layers&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, let's style those layers. The key is to use position: absolute and inset: 0 to make them all fill the .glass-container perfectly, then control their stacking with z-index.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* The main container holds all the layers 
*/
.glass-container {
  position: relative;
  border-radius: 1rem; /* Or any border-radius you want */
  overflow: hidden;    /* Crucial to contain the effect */
}

/* Layer 4: The Distortion Filter */
.glass-filter {
  position: absolute;
  inset: 0;
  z-index: 0;

  /* This is the key! We set blur(0px) to enable backdrop-filter,
    but use our custom SVG filter for the *actual* effect.
  */
  backdrop-filter: blur(0px); 
  filter: url(#lg-dist); /* This points to our SVG filter's ID */

  /* Fixes stacking context issues in some browsers */
  isolation: isolate; 
}

/* Layer 3: The Semi-Transparent Background */
.glass-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.25); /* Your glass color */
}

/* Layer 2: The "Light" Highlight */
.glass-specular {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit; /* Matches the parent's border-radius */
  overflow: hidden;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 0 5px rgba(255, 255, 255, 0.75);
}

/* Layer 1: Your Content */
.glass-content {
  position: relative; /* Sits normally on top */
  z-index: 3;
  padding: 1rem; /* Give your content some space */
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;The Magic: Breaking Down the SVG Filter&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The real star of the "Apple Liquid Glass" effect is the . It works in three steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;: This creates a "noise" pattern, like static on an old TV. We use type="fractalNoise" to make it look more natural and organic.&lt;/li&gt;
&lt;li&gt;: The raw noise is too sharp. We apply a simple blur to it, which makes the noise "clump" together into softer, blob-like shapes.&lt;/li&gt;
&lt;li&gt;: This is the mind-bending part. It takes the blurred noise pattern and uses it as a map to distort the original content (in="SourceGraphic"). The scale="70" attribute controls how intense the ripple effect is.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And that's it! By combining these CSS layers with the power of SVG filters, you move beyond simple blurring and create a truly unique and dynamic "Apple Liquid Glass" effect.&lt;/p&gt;

&lt;p&gt;Browser Compatibility&lt;/p&gt;

&lt;p&gt;This effect relies on two key technologies, and their support is very good, but not universal.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;SVG Filters (feTurbulence, etc.): This is the core of the "liquid" look. SVG filters are widely supported across all modern browsers, including Chrome, Firefox, Safari, and Edge. You can use this part of the effect with high confidence.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;backdrop-filter&lt;/code&gt;: This is what allows the element to distort the content behind it.Supported: Safari (all versions), Chrome, Edge, and Firefox (v103+).Not Supported: Internet Explorer.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In summary: The effect will work perfectly for the vast majority of users on modern browsers. For browsers that don't support backdrop-filter, the "liquid" distortion won't apply to the background image, but the element will still have its semi-transparent background and specular highlight, gracefully degrading to a simpler glassmorphism effect.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>css</category>
      <category>ui</category>
    </item>
    <item>
      <title>Mastering Regular Expressions: A Semantic Approach to Regex</title>
      <dc:creator>Fábio Leal</dc:creator>
      <pubDate>Sun, 29 Sep 2024 10:13:41 +0000</pubDate>
      <link>https://dev.to/fabiosleal/mastering-regular-expressions-a-semantic-approach-to-regex-4jmp</link>
      <guid>https://dev.to/fabiosleal/mastering-regular-expressions-a-semantic-approach-to-regex-4jmp</guid>
      <description>&lt;p&gt;Regular expressions (regex) can often seem like a mysterious art form. But once you grasp the core concepts, regex becomes a powerful tool to solve problems like data validation, extraction, and transformation. In this article, I’ll guide you through a structured approach to mastering regex, helping you understand it from a &lt;strong&gt;semantic&lt;/strong&gt; perspective.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Regex? 🤔
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Regex&lt;/strong&gt; is a sequence of characters that define a search pattern. This pattern is used to find, extract, or replace parts of strings. Here’s an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;^\s{2}title: "\\\'"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This regex matches strings that start with &lt;strong&gt;two spaces&lt;/strong&gt; followed by the literal string &lt;code&gt;"title: "'\"&lt;/code&gt;. Regex is more than just matching—it allows you to define patterns for structured text search."&lt;/p&gt;




&lt;h2&gt;
  
  
  Step-by-Step Path to Regex Mastery 🚀
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Learn the Basics
&lt;/h3&gt;

&lt;p&gt;Before diving into complex regex patterns, start with these basic building blocks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Literals&lt;/strong&gt;: Matches exact text. For example, &lt;code&gt;abc&lt;/code&gt; matches "abc".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Meta-characters&lt;/strong&gt;: These are special characters like &lt;code&gt;.&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;+&lt;/code&gt;, and &lt;code&gt;?&lt;/code&gt;. Each has a unique meaning. For example, &lt;code&gt;.&lt;/code&gt; matches any character except a newline.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Anchors&lt;/strong&gt;: Use &lt;code&gt;^&lt;/code&gt; to match the start of a string or line, and &lt;code&gt;$&lt;/code&gt; to match the end.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Character Classes&lt;/strong&gt;: Define sets of characters using square brackets, like &lt;code&gt;[a-z]&lt;/code&gt; to match any lowercase letter.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Quantifiers&lt;/strong&gt;: These specify the number of occurrences to match. For example, &lt;code&gt;a{2,}&lt;/code&gt; matches "aa" or more.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;In the example below, this regex validates email addresses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It matches a string like &lt;code&gt;test@example.com&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fngmfnmsdioopk3lzghrn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fngmfnmsdioopk3lzghrn.png" alt="regex example matching email, validating start and end"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1btue92384851sikwmww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1btue92384851sikwmww.png" alt="regex example matching email"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Understand Grouping and Capturing 🎯
&lt;/h3&gt;

&lt;p&gt;Regex &lt;strong&gt;groups&lt;/strong&gt; let you organize parts of your pattern and &lt;strong&gt;capture&lt;/strong&gt; values for reuse. This makes regex more powerful for string transformations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Groups&lt;/strong&gt;: Use parentheses &lt;code&gt;()&lt;/code&gt; to group parts of your regex. For example, &lt;code&gt;(abc)&lt;/code&gt; captures "abc".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Non-Capturing Groups&lt;/strong&gt;: Use &lt;code&gt;(?:abc)&lt;/code&gt; if you don't need to capture a group but want to organize your regex.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Here’s a regex for extracting the date from a log line like &lt;code&gt;2024-09-29 Log entry&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(\d{4})-(\d{2})-(\d{2})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pattern captures the year, month, and day in separate groups, which can be useful for further processing:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9rcrstdgkb8ooqpxkab.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9rcrstdgkb8ooqpxkab.png" alt="regex example date extraction"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Master Lookaheads and Lookbehinds 🔍
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Lookaheads&lt;/strong&gt; and &lt;strong&gt;lookbehinds&lt;/strong&gt; are zero-width assertions that allow you to match a pattern based on what comes before or after it, without actually consuming those characters. This is powerful when you want to ensure a pattern is followed by or preceded by something.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lookahead&lt;/strong&gt;: &lt;code&gt;(?=...)&lt;/code&gt; matches only if something is followed by a specific pattern.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lookbehind&lt;/strong&gt;: &lt;code&gt;(?&amp;lt;=...)&lt;/code&gt; matches only if something is preceded by a specific pattern.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;To match the word &lt;code&gt;"car"&lt;/code&gt; only if it is followed by &lt;code&gt;"park"&lt;/code&gt;, you would use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;car(?=park)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This matches &lt;code&gt;"car"&lt;/code&gt; in &lt;code&gt;"carpark"&lt;/code&gt; but not in &lt;code&gt;"carpet"&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhir8i1d2l5ba3inygjn0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhir8i1d2l5ba3inygjn0.png" alt="regex lookahead example"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Practice Common Use Cases 🛠
&lt;/h3&gt;

&lt;p&gt;By practicing, you'll get more comfortable with how to apply regex in real-world scenarios. Start with these common use cases:&lt;/p&gt;

&lt;h4&gt;
  
  
  4.1. Validating Input 📝
&lt;/h4&gt;

&lt;p&gt;Create patterns to ensure data matches certain formats, like phone numbers, emails, or URLs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Phone number validation&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  ^\(\d{3}\) \d{3}-\d{4}$
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;URL validation&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&amp;amp;//=]*)?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  4.2. Extracting Data 📄
&lt;/h4&gt;

&lt;p&gt;Regex is fantastic for extracting specific parts of text. Here’s an example for extracting prices from a string like &lt;code&gt;Total cost: $45.99&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\$\d+\.\d{2}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It matches any currency amount in the format &lt;code&gt;$XX.XX&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  5. Apply Regex in Code 💻
&lt;/h3&gt;

&lt;p&gt;Once you’re comfortable with regex syntax, start applying it in your programming environment. Here’s how you can use regex in different languages:&lt;/p&gt;

&lt;h4&gt;
  
  
  5.1. JavaScript Example
&lt;/h4&gt;

&lt;p&gt;In JavaScript, regex can be used with the &lt;code&gt;RegExp&lt;/code&gt; object:&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;let&lt;/span&gt; &lt;span class="nx"&gt;regex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sr"&gt;/^&lt;/span&gt;&lt;span class="se"&gt;\d{3}&lt;/span&gt;&lt;span class="sr"&gt;-&lt;/span&gt;&lt;span class="se"&gt;\d{2}&lt;/span&gt;&lt;span class="sr"&gt;-&lt;/span&gt;&lt;span class="se"&gt;\d{4}&lt;/span&gt;&lt;span class="sr"&gt;$/&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;regex&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;123-45-6789&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  5.2. Python Example
&lt;/h4&gt;

&lt;p&gt;Python’s &lt;code&gt;re&lt;/code&gt; module makes working with regex very straightforward:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;
&lt;span class="n"&gt;pattern&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;^\d{3}-\d{2}-\d{4}$&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;123-45-6789&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also integrate regex into your React projects for form validation, data parsing, and more.&lt;/p&gt;




&lt;h3&gt;
  
  
  6. Explore Advanced Techniques 🧠
&lt;/h3&gt;

&lt;p&gt;Once you're comfortable with the basics, you can start exploring advanced regex techniques:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Backreferences&lt;/strong&gt;: Reuse matched groups later in the pattern. For example, &lt;code&gt;(a)\1&lt;/code&gt; matches "aa".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Named Capturing Groups&lt;/strong&gt;: Add meaning to your capture groups by naming them.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  (?&amp;lt;year&amp;gt;\d{4})-(?&amp;lt;month&amp;gt;\d{2})-(?&amp;lt;day&amp;gt;\d{2})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Atomic Groups&lt;/strong&gt;: Prevent backtracking in specific cases to improve performance with &lt;code&gt;(?&amp;gt;...)&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  7. Resources for Deep Learning 📚
&lt;/h3&gt;

&lt;p&gt;To truly master regex, you’ll need to learn continuously. Here are some key resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Regex101&lt;/strong&gt; (&lt;a href="https://regex101.com" rel="noopener noreferrer"&gt;regex101.com&lt;/a&gt;): Interactive regex tester with real-time explanation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;RegExr&lt;/strong&gt; (&lt;a href="https://regexr.com" rel="noopener noreferrer"&gt;regexr.com&lt;/a&gt;): Visual regex builder with examples.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mastering Regular Expressions&lt;/strong&gt; by Jeffrey Friedl: The go-to book for regex mastery.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  8. Engage with the Community 👩‍💻👨‍💻
&lt;/h3&gt;

&lt;p&gt;Regex is often best learned through practice and collaboration. Engage with the community to solve problems and get feedback:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stack Overflow&lt;/strong&gt;: There’s always someone asking interesting regex questions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;LeetCode&lt;/strong&gt; and &lt;strong&gt;Codewars&lt;/strong&gt;: Try regex-based coding challenges.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DEV&lt;/strong&gt;: &lt;a href="https://dev.to/search?q=regex"&gt;Yes, here!&lt;/a&gt; We have great contents, articles, tutorials about regex.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Conclusion 🎉
&lt;/h3&gt;

&lt;p&gt;Mastering regex requires both learning the theory and applying it in practical contexts. By following this semantic approach, you’ll gain confidence in crafting powerful patterns for a variety of tasks. From a basic validation to an advanced text extraction, regex will become an indispensable part of your toolkit.&lt;/p&gt;

&lt;p&gt;Are you ready to conquer regex? 🚀&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Feel free to add your favorite regex tips or use cases in the comments below!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>regex</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Create Separate Partitions for Boot, Root, Home, and Swap on Pop!_OS (Updated)</title>
      <dc:creator>Fábio Leal</dc:creator>
      <pubDate>Fri, 22 Dec 2023 14:05:39 +0000</pubDate>
      <link>https://dev.to/fabiosleal/how-to-create-separate-partitions-for-boot-home-and-swap-on-popos-10lg</link>
      <guid>https://dev.to/fabiosleal/how-to-create-separate-partitions-for-boot-home-and-swap-on-popos-10lg</guid>
      <description>&lt;p&gt;An important aspect of system management in the world of Linux is the organization of directories. A common practice among Linux users and experienced professionals is to isolate certain directories from the rest of the operating system. This approach, while not mandatory, can provide many benefits that enhance the overall experience of using and maintaining a Linux system.&lt;/p&gt;

&lt;p&gt;One such directory that is often isolated is the &lt;code&gt;/home&lt;/code&gt; directory. Separating the &lt;code&gt;/home&lt;/code&gt; directory from the rest of the operating system has many advantages. For example, it simplifies major upgrades. This is because you can install a new or different Linux distribution without losing most of your personal files and user-specific settings.&lt;/p&gt;

&lt;p&gt;Also, it allows more efficient management of disk space. You can increase or decrease the size of the home partition and the root partition independently without affecting the layout of the other, simplifying maintenance. If your root directory (&lt;code&gt;/&lt;/code&gt;) becomes full, it can severely impact system performance. Having a separate &lt;code&gt;/home&lt;/code&gt; partition helps keep your root directory as empty as possible.&lt;/p&gt;

&lt;p&gt;Here's a step-by-step guide on how to create separate partitions for the &lt;strong&gt;EFI System Partition (ESP)&lt;/strong&gt;, &lt;code&gt;/&lt;/code&gt; (root), &lt;code&gt;/home&lt;/code&gt;, and &lt;code&gt;swap&lt;/code&gt; on Pop!_OS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Please note that this process will erase all data on the drive you're partitioning, so make sure to back up any important data before proceeding.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step-by-Step Guide
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Boot into Pop!_OS Live Disk
&lt;/h4&gt;

&lt;p&gt;Restart your computer and boot from the Pop!_OS installation media (USB/DVD). Choose 'Try Demo Mode' when prompted.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Open GParted
&lt;/h4&gt;

&lt;p&gt;Once you're in the live environment, open GParted. It's a powerful tool for managing partitions.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Select the Correct Drive
&lt;/h4&gt;

&lt;p&gt;In GParted, make sure you've selected the correct drive from the dropdown in the top-right corner.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Create a New Partition Table
&lt;/h4&gt;

&lt;p&gt;From the 'Device' menu, select 'Create Partition Table'. Choose &lt;strong&gt;'gpt' (GUID Partition Table)&lt;/strong&gt; for modern &lt;strong&gt;UEFI systems&lt;/strong&gt; (which is the standard) or 'msdos' for older, legacy BIOS systems.&lt;/p&gt;

&lt;h4&gt;
  
  
  5. Create the EFI System Partition (ESP) - &lt;em&gt;The Boot Partition&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;This partition is required for Pop!_OS to boot via UEFI.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on the unallocated space and select 'New'.&lt;/li&gt;
&lt;li&gt;Enter &lt;strong&gt;512&lt;/strong&gt; in the 'New size (MiB)' field to create a &lt;strong&gt;512 MiB&lt;/strong&gt; partition.&lt;/li&gt;
&lt;li&gt;Under 'File system', select &lt;strong&gt;'fat32'&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click 'Add'.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  6. Create the &lt;code&gt;/&lt;/code&gt; (Root) Partition
&lt;/h4&gt;

&lt;p&gt;Repeat the process to create the root partition.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The size depends on your needs, but &lt;strong&gt;40GB to 60GB&lt;/strong&gt; is a safer minimum now to comfortably accommodate system files and installed applications.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;'ext4'&lt;/strong&gt; as the file system.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  7. Create the &lt;code&gt;/home&lt;/code&gt; Partition
&lt;/h4&gt;

&lt;p&gt;Repeat the process to create the home partition.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can use the rest of the available space for this partition.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;'ext4'&lt;/strong&gt; as the file system.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  8. Create the &lt;code&gt;swap&lt;/code&gt; Partition (Optional)
&lt;/h4&gt;

&lt;p&gt;If you want to create a dedicated swap partition, repeat the process one more time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The size should be &lt;strong&gt;equal to your RAM if you intend to use hibernation&lt;/strong&gt;, or &lt;strong&gt;4GB to 8GB&lt;/strong&gt; for general use on systems with more than 8GB of RAM.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Note: Pop!_OS uses a flexible **swap file&lt;/em&gt;* by default if you choose not to create a dedicated partition, which is often a simpler option.*&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  9. Apply Changes
&lt;/h4&gt;

&lt;p&gt;Click on the green checkmark to apply the changes. This will format the drive and create the partitions.&lt;/p&gt;

&lt;h4&gt;
  
  
  10. Install Pop!_OS
&lt;/h4&gt;

&lt;p&gt;Close GParted and open the Pop!_OS installer. When you get to the partitioning section, choose &lt;strong&gt;'Custom (Advanced)'&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Assign the mount points:&lt;/strong&gt; Assign the mount points (&lt;code&gt;/&lt;/code&gt;, &lt;code&gt;/home&lt;/code&gt;) to the corresponding &lt;code&gt;ext4&lt;/code&gt; partitions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Designate Boot:&lt;/strong&gt; Set the &lt;strong&gt;FAT32 partition (512 MiB)&lt;/strong&gt; as the &lt;strong&gt;EFI System Partition&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set Swap:&lt;/strong&gt; Set the &lt;code&gt;swap&lt;/code&gt; partition's &lt;strong&gt;usage type to 'swap'&lt;/strong&gt; (it does not get a mount point).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Please note&lt;/strong&gt; that these steps are quite technical and &lt;strong&gt;a mistake could result in data loss&lt;/strong&gt;. If you're not comfortable doing this yourself, consider seeking help from a professional.&lt;/p&gt;

&lt;p&gt;Good luck! 😊&lt;/p&gt;

</description>
      <category>popos</category>
      <category>linux</category>
      <category>ubuntu</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
