added some todo comments, changed logical OR to bitwise OR for regex flags