User Tools

Site Tools


regex
>>> p = re.compile('section{ ( [^}]* ) }', re.VERBOSE)
>>> p.sub(r'subsection{\1}','section{First} section{second}')
'subsection{First} subsection{second}'

references

regex.txt · Last modified: 2013/08/03 05:04 by 127.0.0.1