Python 3
I have recently started reading regex and consider the following case :
If input is AB followed by C or D i want to replace it with EF
So, my char class is [CD] and it should be non-capturing.
Using the re.sub i come up with the following:
re.sub(r'AB(?:[CD])','EF',text)
When i run this code for input ABCZ i get EFZ
Thanks!