Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Tuesday, August 25, 2020

Python 3: RegEx Back References

Regual Expressions is one of those things that isn't completely regular when switching between languages. This is how you use a back reference in Python.

 
import re

print( re.sub(r'(foo)(bar)',r'\g<2>\g<1>','foobar'))


More info here https://www.regular-expressions.info/replacebackref.html

Tuesday, March 29, 2016

Packt Publishing Daily Free eBooks

Packt Publishing offers a daily free programming related eBook. The marketing must work as I've bought additional books from them