def ParseIsBlock(self): """Returns a CharClass corresponding to one of the Unicode blocks.""" block = [] while self.IsBlockClass.Test(self.theChar): block.append(self.theChar) self.NextChar() block = string.join(block, '') if block.startswith("Is"): try: return CharClass.UCDBlock(block[2:]) except KeyError: raise RegularExpressionError( "Invalid IsBlock name: %s" % block[2:]) else: raise RegularExpressionError("Expected IsBlock [%i]" % self.pos)