def to_lowercase(path):
 _RE_LOWERCASE = re.compile('{([^{]*)}')
 while True:
  m = _RE_LOWERCASE.search(path)
  if (not m):
   break
  path = ((path[:m.start()] + m.group(1).lower()) + path[m.end():])
 path = path.replace('{', '')
 path = path.replace('}', '')
 return path

def to_lowercase ( path ) : _RE_LOWERCASE = re . compile ( '{([^{]*)}' ) while True : m = _RE_LOWERCASE . search ( path ) if ( not m ) : break path = ( ( path [ : m . start ( ) ] + m . group ( 1 ) . lower ( ) ) + path [ m . end ( ) : ] ) path = path . replace ( '{' , '' ) path = path . replace ( '}' , '' ) return path
lowercases any characters enclosed in {} .