Regex to check if . in the string is followed by any of the other regex meta-characters -> ^ $ * + ? { } [ ] \ | ( )
How to do this?
I'm trying to do something like below:
foo.bar -> dot is not followed by any other meta characters, so return false
foo.*bar -> return true (because . is followed by *)
gmail.com -> return false
bar.+gmail -> return true
bar. -> return false
I'm very new to regex. Tried to do something like below:
import re
pattern = re.compile(r"([.][\^$*+?{}\[\]\|()]+)+")
print bool(pattern.match("foo.*bar"))
But it's not correct plz help.