About 457,000 results
Open links in new tab
  1. 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...

  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. 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

  4. python - Using a RegEx to match IP addresses - Stack Overflow

    @Maria - I believe the key here is 'matching' IP addresses, in like: "Here is this 10 Terabyte file/DB, match or list the IP addresses you can find", as opposed to " create a function that receives a string …

  5. Python regex: matching a parenthesis within parenthesis

    Python normally reacts to some escape sequences in its strings, which is why it interprets \( as simple (. You would either have to write \\( or use a raw string, e.g. r'\(' or r"\(". Second, when you use …

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

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

  7. Get the string within brackets in Python - Stack Overflow

    Edit: The regular expression here is a python raw string literal, which basically means the backslashes are not treated as special characters and are passed through to the re.search() method unchanged.

  8. 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.

  9. 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

  10. 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-contained.