2
How do I make a regular expression that this one has to repeat exactly one tot of times? For example, I would like to check if a line in a file contains this |1_CHAR
exactly 8 times. By the way, it is possible for example to say that the character type has to be or espaço
, or o
, or *
?
\w
recognizes an alphanumeric character - I think your regex is right if you take the\w
s (and maybe add a\|
at the end to recognize the 9th vertical bar)– hugomg
That’s the way it is. If you don’t match the
re.match
returnsNone
instead of a Match Object so just converti
to boolean or pass them onif
– hugomg