import re
import json


def parse_sqla_operators(expression):
    """
    Parse expressions like:
        like("%john%")
        ilike("john%")
        similar to("%(ohn|acob)")
        in("('a','b')")
    """
    m = re.match(r"(?P<operator>[\w\s]+)\(+(?P<value>.+)\)+", expression)
    if m:
        o = m.group('operator')
        v = json.loads(m.group('value'))
        return o, v