About 138,000 results
Open links in new tab
  1. python - How to use a variable inside a regular expression - Stack …

    One of the main concepts you have to understand when dealing with special characters in regular expressions is to distinguish between string literals and the regular expression itself.

  2. python - Regular Expressions: Search in list - Stack Overflow

    Dec 20, 2024 · I want to filter strings in a list based on a regular expression. Is there something better than [x for x in list if r.match(x)] ?

  3. How to match a whole word with a regular expression?

    I'm having trouble finding the correct regular expression for the scenario below: Lets say: a = "this is a sample" I want to match whole word - for example match "hi" should return False since "h...

  4. regex - How to match any string from a list of strings in regular ...

    Oct 29, 2015 · How to match any string from a list of strings in regular expressions in python? Asked 10 years ago Modified 3 years, 11 months ago Viewed 176k times

  5. Python: How to use RegEx in an if statement? - Stack Overflow

    bit means that the regular expression compiler gets the escape in \. instead of the python parser interpreting it. The (?i) makes the regex case-insensitive like re.IGNORECASE but self …

  6. python - Regular expression to match a dot - Stack Overflow

    Dec 21, 2012 · To escape the dot or period (.) inside a regular expression in a regular python string, therefore, you must also escape the backslash by using a double backslash (\\), making …

  7. python - Named regular expression group " …

    Apr 8, 2012 · As you may know, Python 1.5 adds a new regular expression module that more closely matches Perl's syntax. We've tried to be as close to the Perl syntax as possible within …

  8. python - Regular expression: Match everything after a particular …

    May 19, 2015 · 23 I am using Python and would like to match all the words after test till a period (full-stop) or space is encountered.

  9. python - Case insensitive regular expression without re.compile ...

    In Python, I can compile a regular expression to be case-insensitive using re.compile:

  10. How to match "any character" in regular expression?

    Feb 24, 2023 · For reference, from regular-expressions.info/dot.html: "JavaScript and VBScript do not have an option to make the dot match line break characters. In those languages, you can …