I should probably say that I'm using a ``while`` to break looping as soon as the ``regionEnd`` is hit (and this could make a difference if you are editing the begininning of a large file)