Updated regex to be used in both window and node