Fixed a bug in regex not being global