sourceforge.jp
slashdot.jp
www.google.com
["hoge", "foo", "bar"]
["hoge", "foo", "bar"]
["", "bbbbbb", "cccccDD", ""]
["", "bbbbbb", "cccccDD", ""]
<match:0-2>
<match:7-14,7-10>
re.match("A(a*)A", "AA").group(1) .. 
m.string .. 3.14
m.group(1) .. 3
m.group(2) .. 14
m.groups() .. ["3", "14"]
m.string .. 3.14
m.group("first") .. 3
m.group("second") .. 14
m.string .. 3.14
m.group("first") .. 3
m.group(2) .. 14
m.string .. 3.14
m.group(1) .. 3
m.group("second") .. 14
chooseif(re.match("hello", "HELLO WORLD"), "match", "not match") .. not match
chooseif(re.match("hello", "HELLO WORLD"):icase, "match", "not match") .. match
m.string .. 3.14
m.group(1) .. 3
m.group(2) .. 14
m.groups() .. ["3", "14"]
m.string .. 3.14
m.group("first") .. 3
m.group("second") .. 14
m.string .. 3.14
m.group("first") .. 3
m.group(2) .. 14
m.string .. 3.14
m.group(1) .. 3
m.group("second") .. 14
chooseif(re.compile("hello").match("HELLO WORLD"), "match", "not match") .. not match
chooseif(re.compile("hello"):icase.match("HELLO WORLD"), "match", "not match") .. match
re.sub(",\\s*", ":", "1234, 567,    890,   123") .. 1234:567:890:123
re.sub("def\\s+([a-zA-Z_][a-zA-Z_0-9]*)\\s*\\(\\s*\\):", "static PyObject*\\npy_\\1(void)\\n{", "def myfunc():") .. static PyObject*
py_myfunc(void)
{
dashrepl(matchobj) = { if (matchobj.group(0) == "-") { return(" ") } else { return("-") } }
re.sub("-{1,2}", dashrepl, "pro----gram-files") .. pro--gram files
re.compile(",\\s*").sub(":", "1234, 567,    890,   123") .. 1234:567:890:123
re.compile("def\\s+([a-zA-Z_][a-zA-Z_0-9]*)\\s*\\(\\s*\\):").sub("static PyObject*\\npy_\\1(void)\\n{", "def myfunc():") .. static PyObject*
py_myfunc(void)
{
dashrepl(matchobj) = { if (matchobj.group(0) == "-") { return(" ") } else { return("-") } }
re.compile("-{1,2}").sub(dashrepl, "pro----gram-files") .. pro--gram files
 sourceforge.jp slashdot.jp www.google.com
 sourceforge.jp slashdot.jp www.google.com
