Problem Description:
Regex needs to accepts all strings of type abc.xyz.mno, it should be composed of multiple strings all joined by '.'. The joi...
For further actions, you may consider blocking this person and/or reporting abuse
With
re
module,fullmatch
is used to match only whole stringWith
regex
module, you can use subexpression call to avoid duplication. Also, possessive quantifiers can be used here to speed up things.Hey thanks for sharing this!
I'm not greatly familiar with regex so I can't speak to efficiency, but this is what I came up with on regexr.com and pythex.org/ (both require multiline to be selected for start/end ^ $ to work)
Note: strangely, your solution didn't have any matches on pythex, but we have the same results on regexr; also, I added an invalid case for a string starting with a '.'
I have used regex101.com/ for figuring it out. It worked for me there a while back and it is not working again! I am not really sure why! Need to learn more about regex I guess.