def split(regexp, string, max_split=0):
    """:yaql:split

    Splits string by regexp matches and returns list of strings.

    :signature: regexp.split(string, maxSplit => 0)
    :receiverArg regexp: regex pattern
    :argType regexp: regex object
    :arg string: string to be splitted
    :argType string: string
    :arg maxSplit: how many first splits to do. 0 by default, which means
        to split by all matches
    :argType maxSplit: integer
    :returnType: list

    .. code::

        yaql> regex("a.").split("abcadc")
        ["", "c", "c"]
        yaql> regex("a.").split("abcadc", maxSplit => 1)
        ["", "cadc"]
    """
    return regexp.split(string, max_split)