Roman Suzi wrote: > >>> re.match("^(123)($)", "123\n").group(1, 2) > ('123', '') > > If $ matches \n, then why doesn't it include it to the > group? $ doesn't match \n, it matches immediately before \n (according to the docs). cg.