Preet Kumar

I am a Writer

Preet Kumar

Hello, I'm Preet Kumar, a passionate Data Scientist and Web Developer with a thirst for continuous learning and exploration. I hold a Bachelor's degree from Mehran University of Engineering and Technology, Jamshoro.

  • Karachi, Pakistan.
  • +92-324-3006800, +92-310-3792195
  • preetkumarmaheshwari@gmail.com
  • https://preetkumarmaheshwari.blogspot.com
Me

Skills

Adeptness in Python, Power BI, SQL, NumPy, Pandas, Matplotlib, and OOP forms a potent skill set for comprehensive data analysis, manipulation, and visualization. This array of skills enables efficient data processing, seamless database interaction, and dynamic visual storytelling, equipping me to unravel insights and drive informed decisions effectively.

Web Design 90%
Python 75%
Basic SQL 80%
OPPs 65%
NumPy 75%
Pandas 75%

Data Manipulation and Analysis

Proficiently handle data manipulation tasks using Python, NumPy, and Pandas, ensuring accurate and insightful analysis.

Visual Insights

Create impactful visualizations with Power BI and Matplotlib, translating complex data trends into clear and actionable insights.

Database

Utilize SQL to navigate and manage databases, extracting crucial information for comprehensive analysis.

Modular Code Development

Implement object-oriented programming (OOP) principles to build modular and adaptable code solutions.

  • Email Validation in Python using Regular Expressions

    Email Validation in Python using Regular Expressions

    Email Validation in Python using Regular Expressions
    Email Validation in Python using Regular Expressions


    Introduction:

    In the world of software sorcery, where every character and pixel matters, there's one spell every developer must master: email validation. Think of it as the magical ward that protects your castle of data from misshapen invaders. In this enchanting guide, we'll embark on a journey into the mystical realm of email validation using Python and the formidable art of regular expressions (regex).


    Why Email Validation Matters:

    Imagine you're the guardian of a treasure chest, and you need a special key to access its riches. Valid email addresses are like those keys—precious, unique, and crucial for granting access to your digital treasures. Beyond data cleanliness, they're your shield against nefarious data invaders. Whether you're managing user accounts or enabling communication, email validation ensures that your data remains pristine and secure.


    The Python Script:

    Behold, our trusty Python script that wields the powers of regex to validate emails:


    
    import re
    
    email_condition = "^[a-z]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$"
    email = input("Enter your email: ")
    
    if re.search(email_condition, email):
        print("Email is Valid")
    else:
        print("Invalid Email")
     

    Understanding the Script:

    Let's break the spell down into its magical incantations:


    1. Importing the `re` Module: We begin our mystical quest by importing the `re` module, the spellbook of regular expressions in Python.

    2. Defining the Regex Pattern: The `email_pattern` variable holds the enchanted regex pattern for email validation. This incantation dissects the email address, separating it into components like the username, domain, and top-level domain (TLD).

    3. User Input: The script humbly requests the user to share their email address through the ancient scroll of `input()`. The mystical input is then stored in the `user_email` variable for examination.

    4. Validation Magic: The heart of our enchantment lies in `re.search(email_pattern, user_email)`. It scours the user's email address for a match with our intricate spell. If a match is discovered, the script sings, "Hark! The email address is valid." If not, it whispers, "Alas! The email address you provided is invalid."


    Code link: https://github.com/preetrathi/Email-validation-in-Python-using-Reg-x


    Customizing the Regex Pattern:

    Our regex pattern is your canvas—customize it to match the unique needs of your quest. Whether your application welcomes email addresses with exotic characters or embraces longer top-level domains (TLDs), you have the power to adapt the regex pattern to your requirements.

    Conclusion:

    Email validation is a universal quest in the realm of software, and Python's `re` module offers you a formidable sword in this noble endeavor. By harnessing the arcane powers of regular expressions, you safeguard your data's sanctity and reliability, fortifying your digital citadel.

    Remember, though, that while regex can ensure the format of an email address, it cannot guarantee its existence or deliverability. For a more holistic email verification journey, consider incorporating additional steps, such as sending a confirmation email.

  • CONTACT ME

    Search This Blog

    Powered by Blogger.

    Blog Archive

    ADDRESS

    Naaz Plaza, Saddar, Karachi, Pakistan

    EMAIL

    preetkumarmaheshwari@gmail.com

    MOBILE

    +9232243006800,
    +923243006800