fork download
  1. import re
  2. text = "book_id=123&start_date>=2023-09-12&end_date<=2023-09-14&status!=return"
  3. print( [re.split(r'(!?=|[><]=?)', x) for x in text.split('&')] )
Success #stdin #stdout 0.03s 9664KB
stdin
Standard input is empty
stdout
[['book_id', '=', '123'], ['start_date', '>=', '2023-09-12'], ['end_date', '<=', '2023-09-14'], ['status', '!=', 'return']]