• Creates a Filter instance from a filter expression.

    A filter expression is based on RFC1960 LDAP filter expressions.

    Some examples of filter expressions are:

    • (name=test) Property name must have the value test case sensitive.
    • (name=*) Property name must have a value (must exist).
    • (keywords=wizard) Property keywords must have the value wizard. If keywords is of type array. This means that one value of the array must match the condition.
    • (name=test*) Property name must start with test.
    • (startLevel <= 10) Property startLevel must be less than or equal to 10.
    • (startLevel >= 10) Property startLevel must be greater than or equal to 10.
    • (! (startLevel = 10)) Property startLevel must not be equal to 10. This is the NOT operator.
    • (& (startLevel < 10) (startLevel > 8)) Property startLevel must be less then 10 and greater then 8. This is the AND operator.
    • (| (startLevel < 10) (startLevel > 10)) Property startLevel must be less then 10 or greater then 10. This is the OR operator.
    • (name~=test) Property name must be equal to test case insensitive, so it matches test, TEST, and TesT for example.
    • (name~=test*) Property name must start with test but case insensitive, so it matches testab, TESTab, and TesTaB for example.

    Parameters

    • filterStringOrInstance: string | Filter

      a filter expression.

    Returns Filter

    The parsed filter or if the filter is already a Filter instance it is directly returned.