speed improvements by discarding libraries and use of pure  native regex