Added some regex code into init