Activity detection using regular expressions