2
I’m trying to use a Pattern to find a certain line in a file, but it’s not working.
This is my Pattern: row = re.compile(r"(|\s[OX\s]\s{3}|)")
With this I want to find basically this Pattern: | | O | X |, that is I want in the middle of the Pipes | | may exist only on the left side: espaço, in the middle: 0 or X or espaço, right: espaço. I’d like you to return to me None if the Pattern is not exactly like this, but is not working.
row = re.compile(r"(|\s[OX\s]\s{3}|)")
exp = re.match(row, line)
If line is different, for example instead of | X | | |, have | X |, works the same!
What’s the matter?
Test site http://regex101.com/r/bL5mO0/1
– Guilherme Lautert