Text this: Polymethacrylate optical sensors for chemical analysis