About 557,000 results
Open links in new tab
  1. Validate user input using regular expressions - Stack Overflow

    Nov 23, 2015 · I would like to be able to validate that the user has entered a valid name within my program. If they have not entered a valid name i want the program to continue to prompt them to enter their name again.

  2. Input Validation in Python - GeeksforGeeks

    Apr 18, 2025 · In Python, input validation is essential for creating robust, error free programs that can handle incorrect or unexpected inputs. Python provides several ways to validate user inputs, let's explore some.

  3. Python: Data validation using regular expression

    Mar 22, 2013 · I am trying to use Python regular expression to validate the value of a variable. The validation rules are as follows: The value can contain any of a-z, A-Z, 0-9 and * (no blank, no -, no ,) The v...

  4. Check if email address valid or not in Python - GeeksforGeeks

    Sep 30, 2024 · Check for a valid email address using RegEx. This regex fullmatch method either returns None (if the pattern doesn’t match) or re.MatchObject contains information about the matching part of the string. This method stops after the first match, so this is best suited for testing a regular expression more than extracting data. Python

  5. Regex validation with WTForms and python - Stack Overflow

    Aug 27, 2014 · I know this was answered a long time ago, but another option I discovered to provide alphanumeric validation on WTForms is AlphaNumeric() from wtforms_validators import AlphaNumeric ... class SignupForm(Form): login_id = StringField('login Id', [DataRequired(), AlphaNumeric()])

  6. Python RegEx - W3Schools

    RegEx can be used to check if a string contains the specified search pattern. Python has a built-in package called re, which can be used to work with Regular Expressions. Import the re module: When you have imported the re module, you can start using regular expressions: Search the string to see if it starts with "The" and ends with "Spain":

  7. How to Validate Input with Regex in Python | by Pavol Kutaj

    Nov 3, 2022 · The aim of this page📝 is to remember how to simply add an input validation and raise ValueError in Python in case it does not conform to my needs.

  8. How to check a valid regex string using Python? - GeeksforGeeks

    Jul 31, 2023 · In this article, we will learn about how to use Python Regex to validate name using IGNORECASE. re.IGNORECASE : This flag allows for case-insensitive matching of the Regular Expression with the given string i.e. expressions like [A-Z] will match lowercase letters, too.

  9. Building A Python Library For Input Validation With Regular Expression

    Sep 23, 2024 · Creating a Python library for input validation can be a game-changer for developers. It streamlines the process of ensuring that user inputs meet specific criteria, which is crucial for maintaining data integrity and security. In this article, we will walk through the steps to create a simple yet effective Python libra

  10. Understanding Regex in Python: A Practical Example

    Jan 3, 2025 · In this blog post, we'll explore how regex is used in Python through a practical example from a customer validation function. Consider a scenario where we need to validate customer information, specifically their first name, last name, and mobile number.

  11. Some results have been removed