M
Mr.SpOOn
Hi,
I'd like to use regular expressions to parse a string and accept only
valid strings. What I mean is the possibility to check if the whole
string matches the regex.
So if I have:
I can match this: 'aaaaaabbb'
'aaaaaabbb'
But I'd like to get None with this: 'aabDDDDb'
Instead it matches the first part:
'aab'
I know this is the expected behaviour, but I'm sure it should be
possible doing what I said.
Are there other methods I don't know about in the re module?
Thanks.
I'd like to use regular expressions to parse a string and accept only
valid strings. What I mean is the possibility to check if the whole
string matches the regex.
So if I have:
I can match this: 'aaaaaabbb'
'aaaaaabbb'
But I'd like to get None with this: 'aabDDDDb'
Instead it matches the first part:
'aab'
I know this is the expected behaviour, but I'm sure it should be
possible doing what I said.
Are there other methods I don't know about in the re module?
Thanks.