lib/core: extend is_numeric to support negatives (!) and e notation