About 149,000 results
Open links in new tab
  1. python - Check if string matches pattern - Stack Overflow

    The re.match(...) will not work if you want to match the full string. For example; re.match("[a-z]+", "abcdef") will give a match; But! re.match("[a-z]+", "abcdef 12345") will also give a match …

  2. python - How can I make a regex match the entire string ... - Stack ...

    Suppose I have a string like test-123. I want to test whether it matches a pattern like test-<number>, where <number> means one or more digit symbols. I tried this code: …

  3. regex - Match groups in Python - Stack Overflow

    python regex of group match. 0. Finding groups in Regex - Python. 6. Regex in Python - Using groups. 0 ...

  4. What is the difference between re.search and re.match?

    Oct 8, 2008 · If you disagree with me, try to find regex for match that is faster than re.search('python', word) and does the same job. – Jeyekomon Commented Jan 22, 2019 at …

  5. regex - Python extract pattern matches - Stack Overflow

    Mar 11, 2013 · You could use something like this: import re s = #that big string # the parenthesis create a group with what was matched # and '\w' matches only alphanumeric charactes p = …

  6. Python regex: matching a parenthesis within parenthesis

    The match m contains exactly what's between those outer parentheses; its content corresponds to the .+ bit of outer. innerre matches exactly one of your ('a', 'b') pairs, again using \(and \) to …

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

    Scan through string looking for a match, and return a corresponding MatchObject instance. Return None if no position in the string matches. so you can do. regex = re.compile(regex_txt, …

  8. regex - Python regular expressions return true/false - Stack Overflow

    Jul 4, 2011 · You can use re.match() or re.search(). Python offers two different primitive operations based on regular expressions: re.match() checks for a match only at the beginning …

  9. Python regex matching in conditionals - Stack Overflow

    I am parsing file and I want to check each line against a few complicated regexs. Something like this if re.match(regex1, line): do stuff elif re.match(regex2, line): do other stuff elif re.match(

  10. python - How to find overlapping matches with a regexp ... - Stack …

    Except for zero-length assertion, character in the input will always be consumed in the matching. If you are ever in the case where you want to capture certain character in the input string more …

Refresh