<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sort_schemas(schemas):
 """Sort a list of SQL schemas in order"""

    def keyfun(v):
        x = SQL_SCHEMA_REGEXP.match(v).groups()
        # x3: 'DEV' should come before ''
        return (int(x[0]), x[1], int(x[2]) if x[2] else None,
                x[3] if x[3] else 'zzz', int(x[4]))

    return sorted(schemas, key=keyfun)