(and souls brave enough to try the portlesson prototype and migrate if you care about performancetry to use the string object' methods rather than things such as regular expressions whenever you can although this is broad rule of thumb and can vary from release to releasesome string methods may be faster because they have less work to do in factwe can learn something from python' own history here today' string object methods began life as python-coded functions in the original string module due to their prevalencethey were later optimized by moving their implementation to the language when you imported stringit internally replaced most of its content with functions imported from the strop extension modulestrop methods were reportedly to , times faster than their python-coded equivalents at the time the result was dramatically faster performance for string client programs without impacting the interface that isstring module clients became instantly faster without having to be modified for the new -based module of coursethese operations evolved further and were finally moved to string object methodstheir only form today but this reflects common pattern in python work similar migration path was applied to the pickle module we met in --the later cpickle recoding in python and _pickle in are compatible but much faster this is great lesson about python developmentmodules can be coded quickly in python at first and translated to later for efficiency if required because the interface to python and extension modules is identical (both are imported modules with callable function attributes) translations of modules are backward compatible with their python prototypes the only impact of the translation of such modules on clients usually is an improvement in performance there is normally no need to move every module to for delivery of an applicationyou can pick and choose performance-critical modules (such as string and picklefor translation and leave others coded in python use the timing and profiling techniques discussed in to isolate which modules will give the most improvement when translated to once you dothe next shows how to go about writing -based extension modules regular expression pattern matching splitting and joining strings is simple way to process textas long as it follows the format you expect for more general text analysis tasks where the structure of your data is not so rigidly definedpython provides regular expression matching utilities especially for the kinds of text associated with domains such as the internet and databases todaythis flexibility can be powerful ally regular expression pattern matching