About 372,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

    Sep 4, 2010 · 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, 1 month ago Modified 4 years ago Viewed 176k times

  5. 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 the total …

  6. python - Regular expression to filter list of strings matching a ...

    Mar 14, 2013 · Regular expression to filter list of strings matching a pattern Asked 12 years, 9 months ago Modified 2 years, 11 months ago Viewed 22k times

  7. python - whitespace in regular expression - Stack Overflow

    Apr 22, 2014 · I have a question, can I say \t is equivalent to \s+ in regular expression.? I have some lines of code :

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

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

  9. python's re: return True if string contains regex pattern

    The regular expression search method returns an object on success and None if the pattern is not found in the string. With that in mind, we return True as long as the search gives us something back.

  10. regex - Question marks in regular expressions - Stack Overflow

    Apr 7, 2011 · @VaradBhatnagar You would need to escape the ? character in your regular expression. As an example in Clojure, if you wanted to match the string foo?, you could use (re-find #"foo\?" …