Introduction to Python Regular Expressions

Searching within a string for another string is pretty easy in Python: [python] >>> str = ‘Hello, world’ >>> print(str.find(‘wor’)) 7 [/python] This is fine if we know exactly what we’re looking for, but what if we’re looking for something not so well-defined? For example, if we want to search for a year, then we […]

Read More

Python Unicode: Encode and Decode Strings (in Python 2.x)

Strings are among the most commonly used data types in Python, and there might be times when you want to (or have to) work with strings containing or entirely made up of characters outside of the standard ASCII set (e.g. characters with accents or other markings). Python 2.x provides a data type called a Unicode […]

Read More