Softwire Interview Question

How to process a string of equations and filter them into different categories.