Rescue and warning

I have an app that gets regexpr from a config file. I check these
using and use rescue to find any with errors. This works
fine but there are some regexprs that generate waringing. Is there
anyway I can trap these warning at run time?