Markup

>>> text = "AC   P97430; O09081; O09082;"
>>> lax = LAX.LAXPositions()
>>> parser.setContentHandler(lax)
>>> parser.parseString(text)
>>> print lax["ac_number"][0].__dict__
{'text': 'P97430', 'startpos': 5, 'attrs': {}, 'endpos': 11}
>>> 

>>> from Bio import MarkupEditor
>>> editor = MarkupEditor.MarkupEditor(text)
>>> for ac_number in lax["ac_number"]:
...     editor.insert_element(ac_number.startpos, ac_number.endpos, "b")
...
>>> import sys
>>> editor.to_file(sys.stdout)
AC   P97430; O09081; O09082;

 
.