About 323,000 results
Open links in new tab
  1. Regular Expression HOWTO — Python 3.13.3 documentation

    3 days ago · Regular expressions (called REs, or regexes, or regex patterns) are essentially a tiny, highly specialized programming language embedded inside Python and made available …

  2. python 3.x - Comparing strings with regex - Stack Overflow

    May 4, 2018 · the easiest way would be to just compare the result to the original string. import re x=re.compile('^[a-zA-z][a-zA-z, ]*') str='some_thing' x.match(str).group(0) == str #-> False str = …

  3. Pattern matching in Python with Regex - GeeksforGeeks

    Jul 6, 2024 · In this article, we will see how pattern matching in Python works with Regex. Regular expressions, also called regex, are descriptions of a pattern of text. It can detect the presence …

  4. String Comparison in Python (Exact/Partial Match, etc.) - nkmk note

    Apr 29, 2025 · Regular expressions allow for more flexible string comparisons. Use re.search() to find a match anywhere in the string, including partial matches. Note that re.match() can also …

  5. Regular Expressions: Regexes in Python (Part 1)

    In previous tutorials in this series, you've seen several different ways to compare string values with direct character-by-character comparison. In this tutorial, you'll learn how to perform more …

  6. Regular Expressions (RE) Module - Search and Match Comparison - Python ...

    Oct 26, 2023 · Python offers different primitive operations based on regular expressions: re.match() checks for a match only at the beginning of the string; re.search() checks for a …

  7. Python String Comparison: 8 Easy Ways You Must Know

    May 15, 2025 · 8 Easy Ways to Compare Strings in Python [+Examples] There are 8 practical ways to compare strings in Python—from basic equality checks to advanced fuzzy matching. …

  8. String Comparison in Python: Best Practices and Techniques

    May 21, 2024 · Python's built-in re module provides powerful regular expression functionality to compare and manipulate strings based on complex patterns. There are external libraries like …

  9. Compare Two Strings Using Regex in Python - Online Tutorials …

    Learn how to compare two strings using regular expressions in Python. This guide provides examples and explanations for effective string comparison.

  10. Matching 2 regular expressions in Python - Stack Overflow

    Sep 27, 2011 · Is it possible to match 2 regular expressions in Python? For instance, I have a use-case wherein I need to compare 2 expressions like this: re.match('google\.com\/maps', …

Refresh