Quantcast
Channel: Python Regular expression matching tuple pairs - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by SigmaPiEpsilon for Python Regular expression matching tuple pairs

Alternatives. First one uses a complement match often used as an alternative to non-greedy search where it is not available.>>> re.findall(r'\(([^)]*)\)',s)['aleakedteaserand, NN', 'abehind,...

View Article



Answer by csabinho for Python Regular expression matching tuple pairs

You didn't make the RegEx ungreedy. The solution is re.findall(r'\((.*?,.*?)\)',s).

View Article

Python Regular expression matching tuple pairs

Looking for a regular expression to match tuple pairs within a list. Have been using the below regular expressions = '[(aleakedteaserand, NN), (abehind, IN), (the, DT)]'re.findall(r'\((.*,.*)\)',s)but...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images