<?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: Raheem</title>
    <description>The latest articles on DEV Community by Raheem (@r4h33m).</description>
    <link>https://dev.to/r4h33m</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%2F124691%2F577dcefc-fbe1-4804-818b-6e622e937ae7.jpg</url>
      <title>DEV Community: Raheem</title>
      <link>https://dev.to/r4h33m</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/r4h33m"/>
    <language>en</language>
    <item>
      <title>CMYK and RGB? HSV and HSL? Introducing the Chromatic Compendium!</title>
      <dc:creator>Raheem</dc:creator>
      <pubDate>Sat, 03 Aug 2019 14:43:40 +0000</pubDate>
      <link>https://dev.to/r4h33m/cmyk-and-rgb-hsv-and-hsl-introducing-the-chromatic-compendium-1d7</link>
      <guid>https://dev.to/r4h33m/cmyk-and-rgb-hsv-and-hsl-introducing-the-chromatic-compendium-1d7</guid>
      <description>&lt;p&gt;A tome lies on a lectern placed by the north wall in the forgotten cathedral. The little light coming through the window reveals dust particles suspended in the stale air, and the spiderwebs crisscrossing the narrow walls glitter in the predawn gloom. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WALK TOWARDS THE LECTERN (y/n)?&lt;/strong&gt; y&lt;/p&gt;

&lt;p&gt;The dust makes you cough as you make your way through the webbed darkness towards the lectern. As you approach, the title of the tome becomes clear:&lt;/p&gt;

&lt;p&gt;THE CHROMATIC COMPENDIUM.&lt;br&gt;
fifth edition, Resel Grun Btel&lt;/p&gt;

&lt;p&gt;The letters of the title are illuminated, and seem to glow in the moody room. You notice that there is no dust on the opus. You pause for a bit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OPEN THE TOME (y/n)?&lt;/strong&gt; n&lt;/p&gt;

&lt;p&gt;You hesitate a little, and stare at the tomes prismatic title. for a moment, you think you hear something. Straining your ears, you can hear a slight tinkling, seemingly originating from the compendium. You take a deep breath...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OPEN THE TOME (y/n)?&lt;/strong&gt; y&lt;/p&gt;

&lt;p&gt;With both hands, you open the tome... Instantly, light fills the room, blinding you. Even with your shut, burning eyes, you keep striving to open it. The tinkling grows louder, and you start to feel sleepy.&lt;/p&gt;

&lt;p&gt;Your hands lose their grip on the book, and you plummet towards the ground. You go right through the dirty tiled floor; and straight into total darkness.&lt;/p&gt;




&lt;p&gt;I really hope you had as much fun reading that introduction as I had writing it. I wanted to try something new, while also paying a small homage to the text based adventure games that for some are more immersive than the "4K HDR" stuff we have today.&lt;/p&gt;

&lt;p&gt;Now it's time to give you what you came for.&lt;/p&gt;

&lt;h2&gt;
  
  
  Colour models: RGB and CMYK.
&lt;/h2&gt;

&lt;p&gt;Simply said, a colour model is a mathematical way of representing a colour. There are two types of colour models: additive and subtractive.&lt;/p&gt;

&lt;p&gt;With light, for example a computer display, colours add to each other. &lt;br&gt;
This is why RGB is an additive colour model. The three primary colours (Red, Blue and Green) work are used to produce all 16 million+ different combinations, constructively. This means that all the primary colours work to make white.&lt;/p&gt;

&lt;p&gt;With paper, on the other hand, the different colours remove from each other. The four primary colours (Cyan, Magenta, Yellow and BlacK) are used to produce 10 million possible colours (as each of the primary colours have 100 steps (or grades) ). It's called subtractive as all the colours work to make black.&lt;/p&gt;

&lt;p&gt;As you probably noticed, RGB can display more colours than CMYK. That is why some of the colours in a digital photo can often appear faded or dull when printed. This meme illustrates it quite well:&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%2Fad644yjzvdodwcyufpb1.jpg" 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%2Fad644yjzvdodwcyufpb1.jpg" alt="RGB vs CMYK"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But why exactly is RGB from 0 - 255? Well, as computers are binary, they work in bits and bytes (8 bits). Each colour value is represented with one byte as data to send to the display. One byte can represent 256 different values so 0 - 255 (including 0). So every complete RGB colour takes exactly 3 bytes of memory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding hue: HSL and HSV
&lt;/h2&gt;

&lt;p&gt;HSL - &lt;strong&gt;H&lt;/strong&gt;ue, &lt;strong&gt;S&lt;/strong&gt;aturation, &lt;strong&gt;L&lt;/strong&gt;ightness&lt;br&gt;
HSV - &lt;strong&gt;H&lt;/strong&gt;ue, &lt;strong&gt;S&lt;/strong&gt;aturation, &lt;strong&gt;V&lt;/strong&gt;alue&lt;/p&gt;

&lt;p&gt;These are alternative representations to RGB. It's a cylindrical model (as in a colour wheel), where all the different hues (pure colours, not tones or shades) are seamlessly blended together. Saturation, then, represents the diameter of our cylinder. It's how intense the hue is; it's "colourfulness". &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%2Fcq22zu1u2uup3urheejb.jpeg" 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%2Fcq22zu1u2uup3urheejb.jpeg" alt="Breakdown of HSV"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These two models differ in their final variable - Lightness/Value. While Lightness is how white a colour is, Value is how bright it is. This means that 100% Lightness would give pure white, no matter what the variables are, but 100% Value only gives pure white when combined with 0% Saturation. That is the primary difference between HSL and HSV, and it is shown visually below - HSL on the left, HSV on the right.&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%2Fimhj3le3uczqpx0pjcf8.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%2Fimhj3le3uczqpx0pjcf8.png" alt="HSL vs HSV"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why were they even developed in the first place? Well, while RGB works very well for computers, HSL/HSV are easier to work with for designers and are more natural for the human perception of colour.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;I hope you enjoyed this quick guide on digital colour representation models, and I want to hear your comments! That's it for now!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>design</category>
      <category>explainlikeimfive</category>
    </item>
    <item>
      <title>Linux 101 - the king of operating systems 👑</title>
      <dc:creator>Raheem</dc:creator>
      <pubDate>Sun, 30 Jun 2019 16:20:32 +0000</pubDate>
      <link>https://dev.to/r4h33m/linux-101-the-king-of-operating-systems-3e83</link>
      <guid>https://dev.to/r4h33m/linux-101-the-king-of-operating-systems-3e83</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Linux is a widely used term when it comes to programming and tech discussions. Most people in the least understand vaguely what it is, but there must be some of us that could do with a rundown. I got my first exposure to Linux and installed Ubuntu in 5th grade, but recently, I've re-discovered it and have installed Arch to use as my daily driver. Since I love talking about Linux, I thought I could write a few paragraphs about the best and most used operating system in the world!&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%2Fcdn.discordapp.com%2Fattachments%2F491225192916320256%2F593739238835617802%2FScreenshot_20190627-114727.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%2Fcdn.discordapp.com%2Fattachments%2F491225192916320256%2F593739238835617802%2FScreenshot_20190627-114727.png" alt="Me talking about Linux even though nobody asked"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Linux 101
&lt;/h2&gt;

&lt;p&gt;Technically, Linux is means the &lt;em&gt;linux kernel&lt;/em&gt; but now it also refers to operating systems than run on this kernel (kernel =&amp;gt; the core of a operating system). It was created by &lt;a href="https://en.wikipedia.org/wiki/Linus_Torvalds" rel="noopener noreferrer"&gt;Linus Torvalds&lt;/a&gt; in 1991, a Finish-American who also created the git version control system. It is similar to Unix, a OS made by AT&amp;amp;T. This is an important distinction. MacOS and BSD flavours are based on Unix, so they are technically not Linux, but they are alike. &lt;/p&gt;

&lt;p&gt;Today, Linux runs the majority of servers and &lt;a href="https://www.android.com/" rel="noopener noreferrer"&gt;smartphones&lt;/a&gt;, so one can say  the internet (and the world) runs on it. The reason for this is the fact that Linux is open source. First of all, servers require stability and security. The open source nature of Linux has ensured this, over decades of work by 8,000+ contributors. In addition to that, it's also free.&lt;/p&gt;

&lt;h2&gt;
  
  
  The king?
&lt;/h2&gt;

&lt;p&gt;But when it comes to consumer desktops and laptops, Linux isn't as widespread. Windows was first to the scene, and became the standard. It's easy to use and compatible with everything.&lt;/p&gt;

&lt;p&gt;But if you are willing to sacrifice these two qualities of Windows, you will quickly find that Linux is exceedingly superior. It's customizability and speed is unparalleled. With the amount of distros (distro =&amp;gt; operating systems based on the linux kernel) there is to choose from, you can find one that truly fits your needs.&lt;/p&gt;

&lt;p&gt;But there's more. As a developer, you can make use of Linux even more. Package managers prevent the $PATH hell, and make installing libraries and framework a breeze. The &lt;a href="https://en.wikipedia.org/wiki/Bash_(Unix_shell)" rel="noopener noreferrer"&gt;bash&lt;/a&gt; shell is an infinitely flexible tool in the right hands, and Linux requires less system resources, allowing you to use more on building your Android app. &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%2Fimg.devrant.com%2Fdevrant%2Frant%2Fr_1101213_ygP3V.jpg" 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%2Fimg.devrant.com%2Fdevrant%2Frant%2Fr_1101213_ygP3V.jpg" alt="Heaviest objects in the universe"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Distro talk
&lt;/h2&gt;

&lt;p&gt;After a great deal of researching, I decided to install &lt;a href="https://www.archlinux.org/" rel="noopener noreferrer"&gt;Arch Linux&lt;/a&gt; on my laptop. Arch offers a great wiki and a barebones, DIY experience. This allows the user to only install what they need, letting them have a smooth experience even on inferior systems. My system idles at 200MB of RAM usage, and can support 18 chrome tabs at just under 2GB of RAM. In comparison, Windows takes 1.5 to 2GB of RAM just idling. Arch also has a large package repository + gigantic community package repository, so I can get all the packages I need! It took some time to get a GUI and make it fit my needs, true, but my desktop looks like this, so that was time well spent. &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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frsznmzdz5ikdagocd433.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frsznmzdz5ikdagocd433.png" alt="My Custom Arch Rice - "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also like &lt;a href="https://linuxmint.com/" rel="noopener noreferrer"&gt;Linux Mint&lt;/a&gt; (Ubuntu based, but lighter) and I  recommended it to beginners. &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;To summarize, if you hear the word "Linux", it's an open source operating system kernel, that is used widely in servers and smartphones today. It's free, secure and fast. It's popular with developers, who are willing to trade ease of use for complete control and transparency. I recommend everyone of you to try it!&lt;/p&gt;

&lt;p&gt;Thanks for reading! What's your favourite Linux distro? What is your customisation/configuration? What's preventing you from trying the best OS in the world? I would love to hear your comments and questions?&lt;/p&gt;

</description>
      <category>linux</category>
      <category>explainlikeimfive</category>
    </item>
    <item>
      <title>⌛Saving time with regular expressions - learn the ways of the regex!⏱</title>
      <dc:creator>Raheem</dc:creator>
      <pubDate>Sat, 05 Jan 2019 21:13:03 +0000</pubDate>
      <link>https://dev.to/r4h33m/saving-time-with-regular-expressions---learn-the-ways-of-the-regex-3n1l</link>
      <guid>https://dev.to/r4h33m/saving-time-with-regular-expressions---learn-the-ways-of-the-regex-3n1l</guid>
      <description>&lt;p&gt;A regular expression, often abbreviated as a regex, is a sequence of characters that defines a search pattern that can be used to find occurrences of the said pattern in a string. With regular expressions one can search strings for phone numbers, dates, ISBN codes, etc, using the regex syntax. Regex syntax is incredibly powerful and makes it possible to write regular expressions that can find practically anything. &lt;/p&gt;

&lt;p&gt;Regular expressions save time because instead of writing each rule with code, you write a small, compact search pattern that includes all the rules for the sequence you are trying to match. Let's say you want a regex to match valid email addresses.&lt;/p&gt;

&lt;p&gt;These are the rules that an email address has to comply with to be a valid one:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No spaces&lt;/li&gt;
&lt;li&gt;Only one "@" sign&lt;/li&gt;
&lt;li&gt;Must have only one ".", and placed after the @ sign&lt;/li&gt;
&lt;li&gt;Must have text after said "@"&lt;/li&gt;
&lt;li&gt;Must have text after said "."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Something like this: &lt;a href="mailto:raheem@dev.to"&gt;raheem@dev.to&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I know that the rules for a valid email address are much more complicated - &lt;a href="https://en.wikipedia.org/wiki/Email_address#Examples"&gt;Wikipedia "Email address examples"&lt;/a&gt; - but for the sake of this post, let us follow the rules above.&lt;/p&gt;

&lt;p&gt;Searching text for valid email addresses without using a regular expression could look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;findValidEmailAddresses&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

    &lt;span class="n"&gt;validEmailAddresses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

    &lt;span class="c1"&gt;#Spilt by whitespace, no need to check for whitespaces then
&lt;/span&gt;    &lt;span class="n"&gt;words&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;words&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

        &lt;span class="c1"&gt;#Check if there is only one "@" symbol
&lt;/span&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"@"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;

        &lt;span class="c1"&gt;#Must have text before and after the "@" symbol
&lt;/span&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"@"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"@"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;

        &lt;span class="c1"&gt;#Only one "." symbol after the "@" symbol
&lt;/span&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"@"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;


        &lt;span class="c1"&gt;#"." symbol cannot be directly after the "@" symbol
&lt;/span&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"@"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"."&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;

        &lt;span class="c1"&gt;#Check for text after the "." symbol ("." cannot be the last character)
&lt;/span&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;

        &lt;span class="c1"&gt;#All tests passed, this word is a valid email address
&lt;/span&gt;        &lt;span class="n"&gt;validEmailAddresses&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;#Return the email addresses
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;validEmailAddresses&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;findValidEmailAddresses&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Thanks for reading my post dude. Contact me at plzdont@nooooo.com"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;#Prints ["plzdont@nooooo.com"]
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This is certainly a way, but let's solve the same problem with a regular expression instead.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;re&lt;/span&gt;

&lt;span class="n"&gt;emailRegex&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="nb"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;r"\w+@\w+\.\w+"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;emailRegex&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;findall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Thanks for reading my post dude. Contact me at plzdont@nooooo.com"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;#Prints ["plzdont@nooooo.com"]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;WOW!&lt;/strong&gt; It gets me every time how slick regular expressions are! Let's break down the regex.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="s"&gt;r"\w+@\w+\.\w+"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;"\w"&lt;/strong&gt; is a &lt;strong&gt;character&lt;/strong&gt; that symbolizes any word character.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"+"&lt;/strong&gt; is a &lt;strong&gt;quantifier&lt;/strong&gt; that allows one or more of the previous character.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;"@"&lt;/strong&gt; and the &lt;strong&gt;"."&lt;/strong&gt; are literally what they are, they need to be part of the string for it to match.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;"\"&lt;/strong&gt; before the &lt;strong&gt;"."&lt;/strong&gt; is there because &lt;strong&gt;"."&lt;/strong&gt; on its own is a wildcard character (any character except a line break). The "\" is "escaping" the ".", making it a literal "." That's what we want, not the wildcard character.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In English, the regular expression "\w+@\w+\w+" means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One or more of any word character,&lt;/li&gt;
&lt;li&gt;followed by an "@" symbol,&lt;/li&gt;
&lt;li&gt;followed by one or more of any word character,&lt;/li&gt;
&lt;li&gt;followed by a "." symbol,&lt;/li&gt;
&lt;li&gt;followed by one or more of any word character.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sweet, right? 🍬&lt;/p&gt;

&lt;p&gt;Regex syntax is simple and easy to learn, but with enough complexity that there is no possible sequence of characters that can't be matched with a regex. Also, regular expressions work with any programming language. Learn the syntax once and use it to search for character sequences anywhere!&lt;/p&gt;

&lt;p&gt;Here are some resources to help you reach regex enlightenment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.rexegg.com/regex-quickstart.html"&gt;Comprehensive syntax cheat sheet&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.tutorialspoint.com/python/python_reg_expressions.htm"&gt;Tutorial for how to use the python regular expression "re" library&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://regexr.com/"&gt;Learn about, make, and test regular expressions in your browser&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks for reading my post, I hope you liked it! This is my first post on dev.to and seriously, I was joking about "&lt;a href="mailto:plzdont@nooooo.com"&gt;plzdont@nooooo.com&lt;/a&gt;". If you've got any feedback for me, please comment! What do you think about this humorous style? Should I adopt a more formal tone? More code examples? Not enough emojis? Say it all, I really appreciate it! &lt;/p&gt;

&lt;p&gt;That's it for this one!&lt;/p&gt;

</description>
      <category>python</category>
      <category>tutorial</category>
      <category>learning</category>
      <category>devtips</category>
    </item>
  </channel>
</rss>
