str.sub('(\\w+\\()(\\w+)', & { $m[1] + $m[2].lower() }) .. hoge(abcd, EFGH, IJKL), foo(mnop, QRST), bar(uvwx, 1234)
str.match('(\\w+) (\\w+) (\\w+) (\\w+)')[1 .. 4].join() .. abcdefghijklmnopqrstuvwxyz
str ..    Ă
re.scan('\\w+', str)::group(0) .. ['', '', '', 'Ă']
re.scan('\\w+', str, 10)::group(0) .. ['', '', 'Ă']
re.scan('\\w+', str, 0, 10)::group(0) .. ['', '']
str ..    Ă
str.scan('\\w+')::group(0) .. ['', '', '', 'Ă']
str.scan('\\w+', 10)::group(0) .. ['', '', 'Ă']
str.scan('\\w+', 0, 10)::group(0) .. ['', '']
str ..    Ă
str.match('\\w+', 0)[0] .. 
str.match('\\w+', 6)[0] .. 
str.match('\\w+', 12)[0] .. 
str.match('\\w+', 12, 13)[0] .. 
m.string .. 3.14
m[1] .. 3
m[2] .. 14
m.groups() .. ['3', '14']
re.scan('(ba)(.)', 'foobarbazfoobarbaz'):list {|m| [m[0], m[1, 2]] } .. [['bar', ['ba', 'r']], ['baz', ['ba', 'z']], ['bar', ['ba', 'r']], ['baz', ['ba', 'z']]]
sourceforge.jp
slashdot.jp
www.google.com
['hoge', 'foo', 'bar']
['hoge', 'foo', 'bar']
0
100
300
999
9999
['', 'bbbbbb', 'cccccDD', '']
['', 'bbbbbb', 'cccccDD', '']
<match:0-2>
<match:7-14,7-10>
re.match('A(a*)A', 'AA')[1] .. 
m.string .. 3.14
m[1] .. 3
m[2] .. 14
m.groups() .. ['3', '14']
m.string .. 3.14
m['first'] .. 3
m['second'] .. 14
m.string .. 3.14
m['first'] .. 3
m[2] .. 14
m.string .. 3.14
m[1] .. 3
m['second'] .. 14
cond(re.match('hello', 'HELLO WORLD'), 'match', 'not match') .. not match
cond(re.match(re.pattern('hello'):icase, 'HELLO WORLD'), 'match', 'not match') .. match
m.string .. 3.14
m[1] .. 3
m[2] .. 14
m.groups() .. ['3', '14']
m.string .. 3.14
m['first'] .. 3
m['second'] .. 14
m.string .. 3.14
m['first'] .. 3
m[2] .. 14
m.string .. 3.14
m[1] .. 3
m['second'] .. 14
cond(re.pattern('hello').match('HELLO WORLD'), 'match', 'not match') .. not match
cond(re.pattern('hello'):icase.match('HELLO WORLD'), 'match', 'not match') .. match
80097962 IAAJHJGC
36437927 DGEDHJCH
35173010 DFBHDABA
68225831 GICCFIDB
33817252 DDIBHCFC
88388762 IIDIIHGC
09851628 AJIFBGCI
49914666 EJJBEGGG
89109395 IJBAJDJF
69547351 GJFEHDFB
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[0] == '-') { return(' ') } else { return('-') } }
re.sub('-{1,2}', dashrepl, 'pro----gram-files') .. pro--gram files
re.pattern(',\\s*').sub(':', '1234, 567,    890,   123') .. 1234:567:890:123
re.pattern('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[0] == '-') { return(' ') } else { return('-') } }
re.pattern('-{1,2}').sub(dashrepl, 'pro----gram-files') .. pro--gram files
 sourceforge.jp slashdot.jp www.google.com
 sourceforge.jp slashdot.jp www.google.com
