Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> bool(re.search(r'(?:(x)|y)(?(1)y|x)', 'xy'))
- True
- >>> bool(re.search(r'(?:(x)|y)(?(1)y|x)', 'xx'))
- False
- _______________________________________________________________
- having problem with "(?(id/name)y|x)". as per definition - conditional match of regex. y if group with given id or name exists else x.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement