Bläddra i källkod

마크다운 문법 추가, 정규식에 r 추가

Surplus_Up (2DU) 6 år sedan
förälder
incheckning
2caede4645

+ 1 - 1
language/help_tool.py

@@ -13,7 +13,7 @@ for i in list(n_json):
         del n_json[i]
 
 for i in list(o_json):
-    if not re.search('^_', i[0]):
+    if not re.search(r'^_', i[0]):
         if not i in n_json:
             print('o_title : ' + i)
             print('o_text : ' + o_json[i])

+ 3 - 3
route/api_w.py

@@ -20,13 +20,13 @@ def api_w_2(conn, name):
                 data = curs.fetchall()
                 if data:
                     if flask.request.args.get('include', 'include_1'):
-                        include_re = re.compile('\[include\(((?:(?!\)\]).)+)\)\]', re.I)
-                        category_re = re.compile('\[\[(?:(?:category|분류):(?:(?!\[\[|\]\]).)+)\]\]', re.I)
+                        include_re = re.compile(r'\[include\(((?:(?!\)\]).)+)\)\]', re.I)
+                        category_re = re.compile(r'\[\[(?:(?:category|분류):(?:(?!\[\[|\]\]).)+)\]\]', re.I)
 
                         json_data = include_re.sub('', data[0][0])
                         json_data = category_re.sub('', json_data)
 
-                        get_all_change = re.findall('(@(?:[^@]*)@),([^,]*),', flask.request.args.get('change', ''))
+                        get_all_change = re.findall(r'(@(?:[^@]*)@),([^,]*),', flask.request.args.get('change', ''))
                         for i in get_all_change:
                             json_data = json_data.replace(
                                 i[0].replace('<amp>', '&'), 

+ 7 - 7
route/edit.py

@@ -60,9 +60,9 @@ def edit_2(conn, name):
                 run_count = run_count_section(section, content)
 
                 c_data = html.escape('\n' + o_data)
-                c_data = re.sub('\n(?P<in>={1,6})', '<br>\g<in>', c_data)
-                c_data = re.sub('<br>((?:(?:(?!<br>).)*\n*)*)', run_count, c_data)
-                c_data = re.sub('^\n', '', c_data)
+                c_data = re.sub(r'\n(?P<in>={1,6})', '<br>\g<in>', c_data)
+                c_data = re.sub(r'<br>((?:(?:(?!<br>).)*\n*)*)', run_count, c_data)
+                c_data = re.sub(r'^\n', '', c_data)
                 c_data = html.unescape(c_data)
 
                 content = c_data
@@ -113,9 +113,9 @@ def edit_2(conn, name):
             if section:
                 data = html.escape('\n' + old[0][0].replace('\r\n', '\n'))
                 
-                data = re.sub('\n(?P<in>={1,6})', '<br>\g<in>', data)
+                data = re.sub(r'\n(?P<in>={1,6})', '<br>\g<in>', data)
 
-                section_data = re.findall('<br>((?:(?:(?!<br>).)*\n*)*)', data)
+                section_data = re.findall(r'<br>((?:(?:(?!<br>).)*\n*)*)', data)
                 if len(section_data) >= section:
                     data = section_data[section - 1]
                 else:
@@ -178,8 +178,8 @@ def edit_2(conn, name):
         else:
             p_text = load_lang('defalut_edit_help')
 
-        data = re.sub('\n$', '', data)
-        data_old = re.sub('\n$', '', data_old)
+        data = re.sub(r'\n$', '', data)
+        data_old = re.sub(r'\n$', '', data_old)
 
         return easy_minify(flask.render_template(skin_check(), 
             imp = [name, wiki_set(), custom(), other2([' (' + sub + ')', 0])],

+ 1 - 1
route/edit_delete.py

@@ -40,7 +40,7 @@ def edit_delete_2(conn, name, app_var):
             curs.execute(db_change("delete from data where title = ?"), [name])
             conn.commit()
 
-        file_check = re.search('^file:(.+)\.(.+)$', name)
+        file_check = re.search(r'^file:(.+)\.(.+)$', name)
         if file_check:
             file_check = file_check.groups()
             file_directory = os.path.join(

+ 2 - 2
route/edit_many_delete.py

@@ -8,7 +8,7 @@ def edit_many_delete_2(conn, app_var):
         return re_error('/ban')
 
     if flask.request.method == 'POST':
-        all_title = re.findall('([^\n]+)\n', flask.request.form.get('content', '').replace('\r\n', '\n') + '\n')
+        all_title = re.findall(r'([^\n]+)\n', flask.request.form.get('content', '').replace('\r\n', '\n') + '\n')
         for name in all_title:
             curs.execute(db_change("select data from data where title = ?"), [name])
             data = curs.fetchall()
@@ -34,7 +34,7 @@ def edit_many_delete_2(conn, app_var):
                 curs.execute(db_change("delete from data where title = ?"), [name])
                 conn.commit()
 
-            file_check = re.search('^file:(.+)\.(.+)$', name)
+            file_check = re.search(r'^file:(.+)\.(.+)$', name)
             if file_check:
                 file_check = file_check.groups()
                 file_directory = os.path.join(

+ 1 - 1
route/edit_req.py

@@ -11,7 +11,7 @@ def edit_req_2(conn, name):
         section = flask.request.args.get('section', None)
 
     if acl_check(name) == 1:
-        if acl_check(name, 'edit_req') == 1 or re.search('^user:', name) or get_ver:
+        if acl_check(name, 'edit_req') == 1 or re.search(r'^user:', name) or get_ver:
             return re_error('/ban')
     else:
         if not get_ver:

+ 3 - 3
route/func_upload.py

@@ -32,7 +32,7 @@ def func_upload_2(conn):
             
             curs.execute(db_change("select html from html_filter where kind = 'extension'"))
             extension = [i[0].lower() for i in curs.fetchall()]
-            if not re.sub('^\.', '', value).lower() in extension:
+            if not re.sub(r'^\.', '', value).lower() in extension:
                 return re_error('/error/14')
 
             if flask.request.form.get('f_name', None):
@@ -41,7 +41,7 @@ def func_upload_2(conn):
                 name = data.filename
 
             piece = os.path.splitext(name)
-            if re.search('[^ㄱ-힣0-9a-zA-Z_\- ]', piece[0]):
+            if re.search(r'[^ㄱ-힣0-9a-zA-Z_\- ]', piece[0]):
                 return re_error('/error/22')
 
             e_data = sha224_replace(piece[0]) + piece[1]
@@ -70,7 +70,7 @@ def func_upload_2(conn):
             else:
                 lice = flask.request.form.get('f_lice_sel', '')
                 lice += '[br][br]'  + flask.request.form.get('f_lice', '')
-                lice += '[[category:' + re.sub('\]', '_', flask.request.form.get('f_lice_sel', '')) + ']]'
+                lice += '[[category:' + re.sub(r'\]', '_', flask.request.form.get('f_lice_sel', '')) + ']]'
 
             if os.path.exists(os.path.join(app_var['path_data_image'], e_data)):
 

+ 3 - 3
route/give_acl.py

@@ -11,7 +11,7 @@ def give_acl_2(conn, name):
     else:
         check_data = None
 
-    user_data = re.search('^user:(.+)$', name)
+    user_data = re.search(r'^user:(.+)$', name)
     if user_data:
         if check_data and ip_or_user(ip) != 0:
             return redirect('/login')
@@ -68,7 +68,7 @@ def give_acl_2(conn, name):
     else:
         data = '<h2>' + load_lang('document_acl') + '</h2><hr class=\"main_hr\"><select name="decu" ' + check_ok + '>'
 
-        if re.search('^user:', name):
+        if re.search(r'^user:', name):
             acl_list = get_acl_list('user')
         else:
             acl_list = get_acl_list()
@@ -85,7 +85,7 @@ def give_acl_2(conn, name):
 
         data += '</select>'
 
-        if not re.search('^user:', name):
+        if not re.search(r'^user:', name):
             data += '<hr class=\"main_hr\"><h2>' + load_lang('discussion_acl') + '</h2><hr class=\"main_hr\"><select name="dis" ' + check_ok + '>'
 
             curs.execute(db_change("select dis, why, view from acl where title = ?"), [name])

+ 1 - 1
route/inter_wiki_del.py

@@ -23,6 +23,6 @@ def inter_wiki_del_2(conn, tools, name):
 
         conn.commit()
 
-        return redirect('/' + re.sub('^del_', '', tools))
+        return redirect('/' + re.sub(r'^del_', '', tools))
     else:
         return re_error('/error/3')

+ 1 - 1
route/inter_wiki_plus.py

@@ -88,7 +88,7 @@ def inter_wiki_plus_2(conn, tools, name):
 
         conn.commit()
 
-        return redirect('/' + re.sub('^plus_', '', tools))
+        return redirect('/' + re.sub(r'^plus_', '', tools))
     else:
         if admin_check(1) != 1:
             stat = 'disabled'

+ 1 - 1
route/list_acl.py

@@ -8,7 +8,7 @@ def list_acl_2(conn):
     curs.execute(db_change("select title, why from acl where decu != '' or dis != '' or view != '' order by title desc"))
     list_data = curs.fetchall()
     for data in list_data:
-        if not re.search('^user:', data[0]) and not re.search('^file:', data[0]):
+        if not re.search(r'^user:', data[0]) and not re.search(r'^file:', data[0]):
             curs.execute(db_change("select time from re_admin where what like ? order by time desc limit 1"), ['acl (' + data[0] + ')%'])
             time_data = curs.fetchall()
             if time_data:

+ 1 - 1
route/list_block.py

@@ -79,7 +79,7 @@ def list_block_2(conn, name, tool):
 
         if data[2] == '':
             admin = ''
-        elif re.search('^tool:', data[2]):
+        elif re.search(r'^tool:', data[2]):
             admin = data[2]
         else:
             admin = ip_pas(data[2])

+ 1 - 1
route/list_old_page.py

@@ -26,7 +26,7 @@ def list_old_page_2(conn):
     ''), [sql_num])
     n_list = curs.fetchall()
     for data in n_list:
-        div += '<li><a href="/w/' + url_pas(data[0]) + '">' + html.escape(data[0]) + '</a> (' + re.sub(' .*$', '', data[1]) + ')</li>'
+        div += '<li><a href="/w/' + url_pas(data[0]) + '">' + html.escape(data[0]) + '</a> (' + re.sub(r' .*$', '', data[1]) + ')</li>'
 
     div += '</ul>' + next_fix('/old_page?num=', num, n_list)
 

+ 1 - 1
route/login_need_email.py

@@ -39,7 +39,7 @@ def login_need_email_2(conn, tool):
                 flask.session['c_pw'] = ''
 
             if 'c_id' in flask.session:
-                data = re.search('@([^@]+)$', flask.request.form.get('email', ''))
+                data = re.search(r'@([^@]+)$', flask.request.form.get('email', ''))
                 if data:
                     data = data.group(1)
 

+ 1 - 1
route/login_register.py

@@ -28,7 +28,7 @@ def login_register_2(conn):
         if flask.request.form.get('pw', None) != flask.request.form.get('pw2', None):
             return re_error('/error/20')
 
-        if re.search('(?:[^A-Za-zㄱ-힣0-9 ])', flask.request.form.get('id', None)):
+        if re.search(r'(?:[^A-Za-zㄱ-힣0-9 ])', flask.request.form.get('id', None)):
             return re_error('/error/8')
 
         curs.execute(db_change('select html from html_filter where kind = "name"'))

+ 2 - 2
route/main_file.py

@@ -10,11 +10,11 @@ def main_file_2(conn, data):
             data = open('./views/main_css/file/easter_egg.html', encoding='utf8').read(),
             menu = 0
         ))
-    elif re.search('\.txt$', data, flags = re.I) or data == 'sitemap.xml':
+    elif re.search(r'\.txt$', data, flags = re.I) or data == 'sitemap.xml':
         if data == 'robots.txt' and not os.path.exists('robots.txt'):
             return flask.Response('User-agent: *\nDisallow: /\nAllow: /$\nAllow: /w/', mimetype = 'text/plain')
         elif os.path.exists(data):
-            if re.search('\.txt$', data, flags = re.I):
+            if re.search(r'\.txt$', data, flags = re.I):
                 return flask.send_from_directory('./', data, mimetype = 'text/plain')
             else:
                 return flask.send_from_directory('./', data, mimetype = 'text/xml')

+ 1 - 1
route/main_image_view.py

@@ -6,7 +6,7 @@ def main_image_view_2(conn, name, app_var):
     if os.path.exists(os.path.join(app_var['path_data_image'], name)):
         return flask.send_from_directory(
             './' + app_var['path_data_image'], name, 
-            mimetype = 'image/' + re.search('\.([^\.]+)$', name).group(1)
+            mimetype = 'image/' + re.search(r'\.([^\.]+)$', name).group(1)
         )
     else:
         return redirect()

+ 3 - 3
route/main_views.py

@@ -3,8 +3,8 @@ from .tool.func import *
 def main_views_2(conn, name):
     curs = conn.cursor()
 
-    if re.search('\/', name):
-        m = re.search('^(.*)\/(.*)$', name)
+    if re.search(r'\/', name):
+        m = re.search(r'^(.*)\/(.*)$', name)
         if m:
             n = m.groups()
             plus = '/' + n[0]
@@ -16,7 +16,7 @@ def main_views_2(conn, name):
         plus = ''
         rename = name
 
-    mime_type = re.search('\.([^\.]+)$', rename).group(1)
+    mime_type = re.search(r'\.([^\.]+)$', rename).group(1)
     if mime_type:
         if mime_type in ['.jpeg', '.jpg', '.gif', '.png', '.webp', '.JPEG', '.JPG', '.GIF', '.PNG', '.WEBP']:
             mime_type = 'image/' + mime_type

+ 16 - 16
route/tool/func.py

@@ -190,7 +190,7 @@ def update(ver_num, set_data):
         curs.execute(db_change("select data from other where name = 'recaptcha'"))
         change_rec = curs.fetchall()
         if change_rec and change_rec[0][0] != '':
-            new_rec = re.search('data-sitekey="([^"]+)"', change_rec[0][0])
+            new_rec = re.search(r'data-sitekey="([^"]+)"', change_rec[0][0])
             if new_rec:
                 curs.execute(db_change("update other set data = ? where name = 'recaptcha'"), [new_rec.group(1)])
             else:
@@ -403,7 +403,7 @@ def ip_or_user(data = ''):
     if data == '':
         data = ip_check()
 
-    if re.search('(\.|:)', data):
+    if re.search(r'(\.|:)', data):
         return 1
     else:
         return 0
@@ -505,16 +505,16 @@ def other2(data):
     return data
 
 def cut_100(data):
-    if re.search('^\/w\/', flask.request.path):
-        data = re.sub('<script>((\n*(((?!<\/script>).)+)\n*)+)<\/script>', '', data)
-        data = re.sub('<hr class="main_hr">((\n*((.+)\n*))+)$', '', data)
-        data = re.sub('<div id="cate_all">((\n*((.+)\n*))+)$', '', data)        
-
-        data = re.sub('<(((?!>).)*)>', ' ', data)
-        data = re.sub('\n', ' ', data)
-        data = re.sub('^ +', '', data)
-        data = re.sub(' +$', '', data)
-        data = re.sub(' {2,}', ' ', data)
+    if re.search(r'^\/w\/', flask.request.path):
+        data = re.sub(r'<script>((\n*(((?!<\/script>).)+)\n*)+)<\/script>', '', data)
+        data = re.sub(r'<hr class="main_hr">((\n*((.+)\n*))+)$', '', data)
+        data = re.sub(r'<div id="cate_all">((\n*((.+)\n*))+)$', '', data)        
+
+        data = re.sub(r'<(((?!>).)*)>', ' ', data)
+        data = re.sub(r'\n', ' ', data)
+        data = re.sub(r'^ +', '', data)
+        data = re.sub(r' +$', '', data)
+        data = re.sub(r' {2,}', ' ', data)
     
         return data[0:100] + '...'
     else:
@@ -637,10 +637,10 @@ def ip_pas(raw_ip, type_d = 0):
         curs.execute(db_change("select data from other where name = 'ip_view'"))
         data = curs.fetchall()
         if data and data[0][0] != '':
-            if re.search('\.', raw_ip):
-                ip = re.sub('\.([^.]*)\.([^.]*)$', '.*.*', raw_ip)
+            if re.search(r'\.', raw_ip):
+                ip = re.sub(r'\.([^.]*)\.([^.]*)$', '.*.*', raw_ip)
             else:
-                ip = re.sub(':([^:]*):([^:]*)$', ':*:*', raw_ip)
+                ip = re.sub(r':([^:]*):([^:]*)$', ':*:*', raw_ip)
 
             if not admin_check(1):
                 hide = 1
@@ -1084,7 +1084,7 @@ def history_plus(title, data, date, ip, send, leng, t_check = '', d_type = ''):
                 id_data
             ])
 
-    send = re.sub('\(|\)|<|>', '', send)
+    send = re.sub(r'\(|\)|<|>', '', send)
     send = send[:128] if len(send) > 128 else send
     send = send + ' (' + t_check + ')' if t_check != '' else send
 

+ 1 - 1
route/tool/init.py

@@ -29,7 +29,7 @@ server_set_var = {
         'display' : 'Markup',
         'require' : 'select',
         'default' : 'namumark',
-        'list' : ['namumark', 'custom', 'raw']
+        'list' : ['namumark', 'markdown', 'custom', 'raw']
     },
     'encode' : {
         'display' : 'Encryption method',

+ 3 - 3
route/tool/mark.py

@@ -26,13 +26,13 @@ def load_conn2(data):
     curs = conn.cursor()
 
 def send_parser(data):
-    if not re.search('^<br>$', data):
+    if not re.search(r'^<br>$', data):
         data = html.escape(data)
 
-        data = re.sub('javascript:', '', data, flags = re.I)
+        data = re.sub(r'javascript:', '', data, flags = re.I)
         data = data.replace('&lt;br&gt;', '')
 
-    link_re = re.compile('&lt;a(?: (?:(?:(?!&gt;).)*))?&gt;(?P<in>(?:(?!&lt;).)*)&lt;\/a&gt;')
+    link_re = re.compile(r'&lt;a(?: (?:(?:(?!&gt;).)*))?&gt;(?P<in>(?:(?!&lt;).)*)&lt;\/a&gt;')
     link_data = link_re.findall(data)
     for i in link_data:
         data = link_re.sub('<a href="/w/' + urllib.parse.quote(i).replace('/','%2F') + '">' + i + '</a>', data, 1)

+ 28 - 4
route/tool/set_mark/markdown.py

@@ -35,13 +35,37 @@ def markdown(conn, data, title, include_num):
             pass
 
         def __call__(self, match):
-            if re.search(r'^http(s)?:\/\/', match[2], flags = re.I):
-                return '<a id="out_link" href="' + match[2] + '">' + match[1] + '</a>'
+            if match[1] == '!':
+                if re.search(r'^http(s)?:\/\/', match[3], flags = re.I):
+                    return '<img alt="' + match[2] + '" src="' + match[3] + '">'
+                else:
+                    file_name = re.search(r'^([^.]+)\.([^.]+)$', match[3])
+                    if file_name:
+                        file_end = file_name.group(2)
+                        file_name = file_name.group(1)
+                    else:
+                        file_name = 'Test'
+                        file_end = 'jpg'
+
+                    file_src = '/image/' + tool.sha224_replace(file_name) + '.' + file_end
+                    file_alt = 'file:' + file_name + '.' + file_end
+
+                    return '' + \
+                        '<img class="' + include_num + 'file_finder_1" alt="' + match[2] + '" src="' + file_src + '">' + \
+                        '<a class="' + include_num + 'file_finder_2" id="not_thing" href="/upload?name=' + tool.url_pas(file_name) + '">' + file_alt + '</a>' + \
+                    ''
             else:
-                return '<a class="' + include_num + 'link_finder" href="/w/' + match[2] + '">' + match[1] + '</a>'
+                if re.search(r'^http(s)?:\/\/', match[3], flags = re.I):
+                    return '<a id="out_link" href="' + match[3] + '">' + match[2] + '</a>'
+                else:
+                    return '<a class="' + include_num + 'link_finder" href="/w/' + match[3] + '">' + match[2] + '</a>'
 
-    link_r = r'\[((?:(?!\]\().)+)\]\(([^\]]+)\)'
+    link_r = r'(!)?\[((?:(?!\]\().)+)\]\(([^\]]+)\)'
     link_do = link_render()
     data = re.sub(link_r, link_do, data)
+
+    data = re.sub(r'\*\*((?:(?!\*\*).)+)\*\*', '<b>\1</b>', data)
+    data = re.sub(r'__((?:(?!__).)+)__', '<i>\1</i>', data)
+
     
     return [data, plus_data, backlink]

+ 218 - 218
route/tool/set_mark/namumark.py

@@ -9,7 +9,7 @@ def nowiki_js(data):
     data = data.replace('"', '\\"')
     data = data.replace('\r', '')
     
-    data = re.sub('^\n', '', data)
+    data = re.sub(r'^\n', '', data)
 
     data = data.replace('\n', '<br>')
 
@@ -20,29 +20,29 @@ def link_fix(main_link):
 
     main_link = main_link.replace('&#x27;', "<link_comma>")
     
-    if re.search('^:', main_link):
-        main_link = re.sub('^:', '', main_link)
+    if re.search(r'^:', main_link):
+        main_link = re.sub(r'^:', '', main_link)
 
-    main_link = re.sub('^사용자:', 'user:', main_link)
-    main_link = re.sub('^파일:', 'file:', main_link)
-    main_link = re.sub('^분류:', 'category:', main_link)
+    main_link = re.sub(r'^사용자:', 'user:', main_link)
+    main_link = re.sub(r'^파일:', 'file:', main_link)
+    main_link = re.sub(r'^분류:', 'category:', main_link)
 
-    other_link = re.search('[^\\\\]?(#[^#]+)$', main_link)
+    other_link = re.search(r'[^\\\\]?(#[^#]+)$', main_link)
     if other_link:
         other_link = other_link.group(1)
 
-        main_link = re.sub('(#[^#]+)$', '', main_link)
+        main_link = re.sub(r'(#[^#]+)$', '', main_link)
     else:
         other_link = ''
 
     main_link = main_link.replace("<link_comma>", "&#x27;")
-    main_link = re.sub('\\\\#', '%23', main_link)
+    main_link = re.sub(r'\\\\#', '%23', main_link)
 
-    find_data = re.findall('<span id="(nowiki_[0-9]+)">', main_link)
+    find_data = re.findall(r'<span id="(nowiki_[0-9]+)">', main_link)
     for i in find_data:
         main_link = main_link.replace('<span id="' + i + '"></span>', end_data[i])
 
-    find_data = re.findall('<span id="(nowiki_[0-9]+)">', other_link)
+    find_data = re.findall(r'<span id="(nowiki_[0-9]+)">', other_link)
     for i in find_data:
         other_link = other_link.replace('<span id="' + i + '"></span>', end_data[i])
 
@@ -63,90 +63,90 @@ def table_parser(data, cel_data, cel_num, start_data, num = 0, cel_color = {}):
     cel_style += cel_color[cel_num]
 
     if num == 0:
-        if re.search('^ ', cel_data) and re.search(' $', cel_data):
+        if re.search(r'^ ', cel_data) and re.search(r' $', cel_data):
             cel_style += 'text-align: center;'
-        elif re.search('^ ', cel_data):
+        elif re.search(r'^ ', cel_data):
             cel_style += 'text-align: right;'
-        elif re.search(' $', cel_data):
+        elif re.search(r' $', cel_data):
             cel_style += 'text-align: left;'
 
-    table_state = re.findall('&lt;((?:(?!&gt;).)+)&gt;', data)
+    table_state = re.findall(r'&lt;((?:(?!&gt;).)+)&gt;', data)
     for in_state in table_state:
         if re.search("^table ?width=([^=]+)$", in_state):
-            table_data = re.sub('^table ?width=', '', in_state)
-            div_style += 'width: ' + ((table_data + 'px') if re.search('^[0-9]+$', table_data) else table_data) + ';'
+            table_data = re.sub(r'^table ?width=', '', in_state)
+            div_style += 'width: ' + ((table_data + 'px') if re.search(r'^[0-9]+$', table_data) else table_data) + ';'
             all_table += 'width: 100%;'
         elif re.search("^table ?height=([^=]+)$", in_state):
-            table_data = re.sub('^table ?height=', '', in_state)
-            div_style += 'height: ' + ((table_data + 'px') if re.search('^[0-9]+$', table_data) else table_data) + ';'
+            table_data = re.sub(r'^table ?height=', '', in_state)
+            div_style += 'height: ' + ((table_data + 'px') if re.search(r'^[0-9]+$', table_data) else table_data) + ';'
         elif re.search("^table ?align=([^=]+)$", in_state):
-            table_data = re.sub('^table ?align=', '', in_state)
+            table_data = re.sub(r'^table ?align=', '', in_state)
             if table_data == 'right':
                 div_style += 'float: right;'
             elif table_data == 'center':
                 all_table += 'margin: auto;'
         elif re.search("^table ?textalign=([^=]+)$", in_state):
             num = 1
-            table_data = re.sub('^table ?textalign=', '', in_state)
+            table_data = re.sub(r'^table ?textalign=', '', in_state)
             if table_data == 'right':
                 all_table += 'text-align: right;'
             elif table_data == 'center':
                 all_table += 'text-align: center;'
         elif re.search("^row ?textalign=([^=]+)$", in_state):
-            table_data = re.sub('^row ?textalign=', '', in_state)
+            table_data = re.sub(r'^row ?textalign=', '', in_state)
             if table_data == 'right':
                 row_style += 'text-align: right;'
             elif table_data == 'center':
                 row_style += 'text-align: center;'
             else:
                 row_style += 'text-align: left;'
-        elif re.search('^-([0-9]+)$', in_state):
-            cel = 'colspan="' + re.sub('^-', '', in_state) + '"'
+        elif re.search(r'^-([0-9]+)$', in_state):
+            cel = 'colspan="' + re.sub(r'^-', '', in_state) + '"'
         elif re.search("^(\^|v)?\|([^|]+)$", in_state):
-            if re.search('^\^', in_state):
+            if re.search(r'^\^', in_state):
                 cel_style += 'vertical-align: top;'
-            elif re.search('^v', in_state):
+            elif re.search(r'^v', in_state):
                 cel_style += 'vertical-align: bottom;'
 
-            row = 'rowspan="' + re.sub('^(\^|v)?\|', '', in_state) + '"'
+            row = 'rowspan="' + re.sub(r'^(\^|v)?\|', '', in_state) + '"'
         elif re.search("^row ?bgcolor=([^=]+)$", in_state):
-            table_data = re.sub('^row ?bgcolor=', '', in_state)
-            row_style += 'background: ' + (re.sub(',([^,]*)', '', table_data) if re.search(',', table_data) else table_data) + ';'
+            table_data = re.sub(r'^row ?bgcolor=', '', in_state)
+            row_style += 'background: ' + (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data) + ';'
         elif re.search("^row ?color=([^=]+)$", in_state):
-            table_data = re.sub('^row ?color=', '', in_state)
-            row_style += 'color: ' + (re.sub(',([^,]*)', '', table_data) if re.search(',', table_data) else table_data) + ';'
+            table_data = re.sub(r'^row ?color=', '', in_state)
+            row_style += 'color: ' + (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data) + ';'
         elif re.search("^table ?bordercolor=([^=]+)$", in_state):
-            table_data = re.sub('^table ?bordercolor=', '', in_state)
-            all_table += 'border: ' + (re.sub(',([^,]*)', '', table_data) if re.search(',', table_data) else table_data) + ' 2px solid;'
+            table_data = re.sub(r'^table ?bordercolor=', '', in_state)
+            all_table += 'border: ' + (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data) + ' 2px solid;'
         elif re.search("^table ?bgcolor=([^=]+)$", in_state):
-            table_data = re.sub('^table ?bgcolor=', '', in_state)
-            all_table += 'background: ' + (re.sub(',([^,]*)', '', table_data) if re.search(',', table_data) else table_data) + ';'
+            table_data = re.sub(r'^table ?bgcolor=', '', in_state)
+            all_table += 'background: ' + (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data) + ';'
         elif re.search("^table ?color=([^=]+)$", in_state):
-            table_data = re.sub('^table ?color=', '', in_state)
-            all_table += 'color: ' + (re.sub(',([^,]*)', '', table_data) if re.search(',', table_data) else table_data) + ';'
+            table_data = re.sub(r'^table ?color=', '', in_state)
+            all_table += 'color: ' + (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data) + ';'
         elif re.search("^col ?bgcolor=([^=]+)$", in_state):
-            table_data = re.sub('^col ?bgcolor=', '', in_state)
-            table_data = (re.sub(',([^,]*)', '', table_data) if re.search(',', table_data) else table_data)
+            table_data = re.sub(r'^col ?bgcolor=', '', in_state)
+            table_data = (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data)
             cel_color[cel_num] += 'background: ' + table_data + ';'
             cel_style += 'background: ' + table_data + ';'
         elif re.search("^col ?color=([^=]+)$", in_state):
-            table_data = re.sub('^col ?color=', '', in_state)
-            table_data = (re.sub(',([^,]*)', '', table_data) if re.search(',', table_data) else table_data)
+            table_data = re.sub(r'^col ?color=', '', in_state)
+            table_data = (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data)
             cel_color[cel_num] += 'color: ' + table_data + ';'
             cel_style += 'color: ' + table_data + ';'
         elif re.search("^(bgcolor=([^=]+)|#(?:[0-9a-f-A-F]{3}){1,2}|\w+)$", in_state):
-            table_data = re.sub('^bgcolor=', '', in_state)
-            cel_style += 'background: ' + (re.sub(',([^,]*)', '', table_data) if re.search(',', table_data) else table_data) + ';'
+            table_data = re.sub(r'^bgcolor=', '', in_state)
+            cel_style += 'background: ' + (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data) + ';'
         elif re.search("^color=([^=]+)$", in_state):
-            table_data = re.sub('^color=', '', in_state)
-            cel_style += 'color: ' + (re.sub(',([^,]*)', '', table_data) if re.search(',', table_data) else table_data) + ';'
+            table_data = re.sub(r'^color=', '', in_state)
+            cel_style += 'color: ' + (re.sub(',([^,]*)', '', table_data) if re.search(r',', table_data) else table_data) + ';'
         elif re.search("^width=([^=]+)$", in_state):
-            table_data = re.sub('^width=', '', in_state)
-            cel_style += 'width: ' + ((table_data + 'px') if re.search('^[0-9]+$', table_data) else table_data) + ';'
+            table_data = re.sub(r'^width=', '', in_state)
+            cel_style += 'width: ' + ((table_data + 'px') if re.search(r'^[0-9]+$', table_data) else table_data) + ';'
         elif re.search("^height=([^=]+)$", in_state):
-            table_data = re.sub('^height=', '', in_state)
-            cel_style += 'height: ' + ((table_data + 'px') if re.search('^[0-9]+$', table_data) else table_data) + ';'
-        elif re.search('^\(|:|\)$', in_state):
+            table_data = re.sub(r'^height=', '', in_state)
+            cel_style += 'height: ' + ((table_data + 'px') if re.search(r'^[0-9]+$', table_data) else table_data) + ';'
+        elif re.search(r'^\(|:|\)$', in_state):
             if in_state == '(':
                 cel_style += 'text-align: right;'
             elif in_state == ':':
@@ -171,34 +171,34 @@ def table_start(data):
         table_end = ''
         cel_color = {}
 
-        table = re.search('\n((?:(?:(?:(?:\|\||\|[^|]+\|)+(?:(?:(?!\|\|).\n*)*))+)\|\|(?:\n)?)+)', data)
+        table = re.search(r'\n((?:(?:(?:(?:\|\||\|[^|]+\|)+(?:(?:(?!\|\|).\n*)*))+)\|\|(?:\n)?)+)', data)
         if table:
-            table = re.sub('(\|\|)+\n', '||\n', table.group(1))
+            table = re.sub(r'(\|\|)+\n', '||\n', table.group(1))
             
-            table_caption = re.search('^\|([^|]+)\|', table)
+            table_caption = re.search(r'^\|([^|]+)\|', table)
             if table_caption:
                 table_caption = '<caption>' + table_caption.group(1) + '</caption>'
                 
-                table = re.sub('^\|([^|]+)\|', '||', table)
+                table = re.sub(r'^\|([^|]+)\|', '||', table)
             else:
                 table_caption = ''
             
             table = '\n' + table
             
-            table_cel = re.findall('(\n(?:(?:\|\|)+)|\|\|\n(?:(?:\|\|)+)|(?:(?:\|\|)+))((?:(?:(?!\n|\|\|).)+\n*)+)', table)
+            table_cel = re.findall(r'(\n(?:(?:\|\|)+)|\|\|\n(?:(?:\|\|)+)|(?:(?:\|\|)+))((?:(?:(?!\n|\|\|).)+\n*)+)', table)
             for i in table_cel:
-                cel_plus = re.search('^((?:&lt;(?:(?:(?!&gt;).)*)&gt;)+)', i[1])
+                cel_plus = re.search(r'^((?:&lt;(?:(?:(?!&gt;).)*)&gt;)+)', i[1])
                 cel_plus = cel_plus.group(1) if cel_plus else ''
-                cel_data = re.sub('^((?:&lt;(?:(?:(?!&gt;).)*)&gt;)+)', '', i[1])
+                cel_data = re.sub(r'^((?:&lt;(?:(?:(?!&gt;).)*)&gt;)+)', '', i[1])
 
-                if re.search('^\n', i[0]):
+                if re.search(r'^\n', i[0]):
                     cel_num = 1
 
                     cel_plus = table_parser(
                         cel_plus, 
                         cel_data,
                         cel_num,
-                        re.sub('^\n', '', i[0]),
+                        re.sub(r'^\n', '', i[0]),
                         table_num,
                         cel_color
                     )
@@ -213,14 +213,14 @@ def table_start(data):
                                     '<td ' + cel_plus[2] + ' ' + cel_plus[3] + ' ' + cel_plus[4] + '>' + \
                                         cel_data
                                         
-                elif re.search('\n', i[0]):
+                elif re.search(r'\n', i[0]):
                     cel_num = 1
 
                     cel_plus = table_parser(
                         cel_plus, 
                         cel_data,
                         cel_num,
-                        re.sub('^\|\|\n', '', i[0]),
+                        re.sub(r'^\|\|\n', '', i[0]),
                         table_num,
                         cel_color
                     )
@@ -239,7 +239,7 @@ def table_start(data):
                         cel_plus, 
                         cel_data,
                         cel_num,
-                        re.sub('^\|\|\n', '', i[0]),
+                        re.sub(r'^\|\|\n', '', i[0]),
                         table_num,
                         cel_color
                     )
@@ -252,7 +252,7 @@ def table_start(data):
 
             table_end += '</td></tr></table></div>'
 
-            data = re.sub('\n((?:(?:(?:(?:\|\||\|[^|]+\|)+(?:(?:(?!\|\|).\n*)*))+)\|\|(?:\n)?)+)', '\n' + table_end + '\n', data, 1)
+            data = re.sub(r'\n((?:(?:(?:(?:\|\||\|[^|]+\|)+(?:(?:(?!\|\|).\n*)*))+)\|\|(?:\n)?)+)', '\n' + table_end + '\n', data, 1)
         else:
             break
 
@@ -271,38 +271,38 @@ def middle_parser(data, include_num):
     syntax_num = 0
     folding_num = 0
 
-    middle_re = re.compile('(?:{{{((?:(?:(?! |{{{|}}}|&lt;).)*) ?)|(}}}))')
+    middle_re = re.compile(r'(?:{{{((?:(?:(?! |{{{|}}}|&lt;).)*) ?)|(}}}))')
     middle_all_data = middle_re.findall(data)
     for middle_data in middle_all_data:
         if not middle_data[1]:
             if middle_stack > 0:
                 middle_stack += 1
 
-                data = re.sub('(?:{{{((?:(?! |{{{|}}}|&lt;).)*)(?P<in> ?)|(}}}))', '<middle_start>' + middle_data[0] + '\g<in>', data, 1)
+                data = re.sub(r'(?:{{{((?:(?! |{{{|}}}|&lt;).)*)(?P<in> ?)|(}}}))', '<middle_start>' + middle_data[0] + '\g<in>', data, 1)
             else:
-                if re.search('^(#|@|\+|\-)', middle_data[0]) and not re.search('^(#|@|\+|\-){2}|(#|@|\+|\-)\\\\', middle_data[0]):
-                    if re.search('^(#(?:[0-9a-f-A-F]{3}){1,2})', middle_data[0]):
-                        middle_search = re.search('^(#(?:[0-9a-f-A-F]{3}){1,2})', middle_data[0])
+                if re.search(r'^(#|@|\+|\-)', middle_data[0]) and not re.search(r'^(#|@|\+|\-){2}|(#|@|\+|\-)\\\\', middle_data[0]):
+                    if re.search(r'^(#(?:[0-9a-f-A-F]{3}){1,2})', middle_data[0]):
+                        middle_search = re.search(r'^(#(?:[0-9a-f-A-F]{3}){1,2})', middle_data[0])
                         middle_list += ['span']
 
                         data = middle_re.sub('<span style="color: ' + middle_search.group(1) + ';">', data, 1)
-                    elif re.search('^(?:#(\w+))', middle_data[0]):
-                        middle_search = re.search('^(?:#(\w+))', middle_data[0])
+                    elif re.search(r'^(?:#(\w+))', middle_data[0]):
+                        middle_search = re.search(r'^(?:#(\w+))', middle_data[0])
                         middle_list += ['span']
 
                         data = middle_re.sub('<span style="color: ' + middle_search.group(1) + ';">', data, 1)
-                    elif re.search('^(?:@((?:[0-9a-f-A-F]{3}){1,2}))', middle_data[0]):
-                        middle_search = re.search('^(?:@((?:[0-9a-f-A-F]{3}){1,2}))', middle_data[0])
+                    elif re.search(r'^(?:@((?:[0-9a-f-A-F]{3}){1,2}))', middle_data[0]):
+                        middle_search = re.search(r'^(?:@((?:[0-9a-f-A-F]{3}){1,2}))', middle_data[0])
                         middle_list += ['span']
 
                         data = middle_re.sub('<span style="background: #' + middle_search.group(1) + ';">', data, 1)
-                    elif re.search('^(?:@(\w+))', middle_data[0]):
-                        middle_search = re.search('^(?:@(\w+))', middle_data[0])
+                    elif re.search(r'^(?:@(\w+))', middle_data[0]):
+                        middle_search = re.search(r'^(?:@(\w+))', middle_data[0])
                         middle_list += ['span']
 
                         data = middle_re.sub('<span style="background: ' + middle_search.group(1) + ';">', data, 1)
-                    elif re.search('^(\+|-)([1-5])', middle_data[0]):
-                        middle_search = re.search('^(\+|-)([1-5])', middle_data[0])
+                    elif re.search(r'^(\+|-)([1-5])', middle_data[0]):
+                        middle_search = re.search(r'^(\+|-)([1-5])', middle_data[0])
                         middle_search = middle_search.groups()
                         if middle_search[0] == '+':
                             font_size = str(int(middle_search[1]) * 20 + 100)
@@ -312,8 +312,8 @@ def middle_parser(data, include_num):
                         middle_list += ['span']
 
                         data = middle_re.sub('<span style="font-size: ' + font_size + '%;">', data, 1)
-                    elif re.search('^#!wiki', middle_data[0]):
-                        middle_data_2 = re.search('{{{#!wiki(?: style=(?:&quot;|&#x27;)((?:(?!&quot;|&#x27;).)*)(?:&quot;|&#x27;))?(?: *)\n?', data)
+                    elif re.search(r'^#!wiki', middle_data[0]):
+                        middle_data_2 = re.search(r'{{{#!wiki(?: style=(?:&quot;|&#x27;)((?:(?!&quot;|&#x27;).)*)(?:&quot;|&#x27;))?(?: *)\n?', data)
                         if middle_data_2:
                             middle_data_2 = middle_data_2.groups()
                         else:
@@ -327,8 +327,8 @@ def middle_parser(data, include_num):
                             data,
                             1
                         )
-                    elif re.search('^#!syntax', middle_data[0]):
-                        middle_data_2 = re.search('{{{#!syntax ((?:(?!\n).)+)\n?', data)
+                    elif re.search(r'^#!syntax', middle_data[0]):
+                        middle_data_2 = re.search(r'{{{#!syntax ((?:(?!\n).)+)\n?', data)
                         if middle_data_2:
                             middle_data_2 = middle_data_2.groups()
                         else:
@@ -347,10 +347,10 @@ def middle_parser(data, include_num):
                             data,
                             1
                         )
-                    elif re.search('^#!folding', middle_data[0]):
+                    elif re.search(r'^#!folding', middle_data[0]):
                         middle_list += ['2div']
 
-                        folding_data = re.search('{{{#!folding ?((?:(?!\n).)*)\n?', data)
+                        folding_data = re.search(r'{{{#!folding ?((?:(?!\n).)*)\n?', data)
                         if folding_data:
                             folding_data = folding_data.groups()
                         else:
@@ -372,7 +372,7 @@ def middle_parser(data, include_num):
                         )
 
                         folding_num += 1
-                    elif re.search('^#!html', middle_data[0]):
+                    elif re.search(r'^#!html', middle_data[0]):
                         middle_list += ['span']
 
                         html_num += 1
@@ -441,7 +441,7 @@ def middle_parser(data, include_num):
     data = data.replace('<middle_end>', '}}}')
 
     while 1:
-        nowiki_data = re.search('<code>((?:(?:(?!<\/code>).)*\n*)*)<\/code>', data)
+        nowiki_data = re.search(r'<code>((?:(?:(?!<\/code>).)*\n*)*)<\/code>', data)
         if nowiki_data:
             nowiki_data = nowiki_data.groups()
 
@@ -464,7 +464,7 @@ def middle_parser(data, include_num):
             break
 
     while 1:
-        syntax_data = re.search('<code class="((?:(?!"|>|<).)+)">((?:\n*(?:(?:(?!<\/code>|<span id="nowiki_).)+)\n*)+)<\/code>', data)
+        syntax_data = re.search(r'<code class="((?:(?!"|>|<).)+)">((?:\n*(?:(?:(?!<\/code>|<span id="nowiki_).)+)\n*)+)<\/code>', data)
         if syntax_data:
             syntax_data = syntax_data.groups()
 
@@ -503,12 +503,12 @@ def namumark(conn, data, title, include_num):
     backlink = []
     end_data = {}
 
-    data = re.sub('<math>(?P<in>(?:(?!<\/math>).)+)<\/math>', '[math(\g<in>)]', data)
+    data = re.sub(r'<math>(?P<in>(?:(?!<\/math>).)+)<\/math>', '[math(\g<in>)]', data)
 
     data = html.escape(data)
     data = data.replace('\r\n', '\n')
 
-    math_re = re.compile('\[math\(((?:(?!\)\]).)+)\)\]', re.I)
+    math_re = re.compile(r'\[math\(((?:(?!\)\]).)+)\)\]', re.I)
     while 1:
         math = math_re.search(data)
         if math:
@@ -526,7 +526,7 @@ def namumark(conn, data, title, include_num):
     data = data.replace('<break_middle>', '\\{')
 
     first = 0
-    math_re = re.compile('<math>((?:(?!<\/math>).)+)<\/math>', re.I)
+    math_re = re.compile(r'<math>((?:(?!<\/math>).)+)<\/math>', re.I)
     while 1:
         math = math_re.search(data)
         if math:
@@ -553,7 +553,7 @@ def namumark(conn, data, title, include_num):
 
     num = 0
     while 1:
-        one_nowiki = re.search('(?:\\\\)(.)', data)
+        one_nowiki = re.search(r'(?:\\\\)(.)', data)
         if one_nowiki:
             one_nowiki = one_nowiki.groups()
 
@@ -566,11 +566,11 @@ def namumark(conn, data, title, include_num):
                 '\n' + \
             ''
 
-            data = re.sub('(?:\\\\)(.)', '<span id="nowiki_' + str(nowiki_num) + '"></span>', data, 1)
+            data = re.sub(r'(?:\\\\)(.)', '<span id="nowiki_' + str(nowiki_num) + '"></span>', data, 1)
         else:
             break
 
-    include_re = re.compile('\[include\(((?:(?!\)\]).)+)\)\]', re.I)
+    include_re = re.compile(r'\[include\(((?:(?!\)\]).)+)\)\]', re.I)
     i = 0
     while 1:
         i += 1
@@ -579,7 +579,7 @@ def namumark(conn, data, title, include_num):
         if include:
             include = include.group(1)
 
-            include_data = re.search('^((?:(?!,).)+)', include)
+            include_data = re.search(r'^((?:(?!,).)+)', include)
             if include_data:
                 include_data = include_data.group(1)
             else:
@@ -595,18 +595,18 @@ def namumark(conn, data, title, include_num):
 
             include_plus_data = []
             while 1:
-                include_plus = re.search(', ?((?:(?!=).)+)=((?:(?!,).)+)', include)
+                include_plus = re.search(r', ?((?:(?!=).)+)=((?:(?!,).)+)', include)
                 if include_plus:
                     include_plus = include_plus.groups()
 
                     include_data_set = include_plus[1]
-                    find_data = re.findall('<span id="(nowiki_[0-9]+)">', include_data_set)
+                    find_data = re.findall(r'<span id="(nowiki_[0-9]+)">', include_data_set)
                     for j in find_data:
                         include_data_set = include_data_set.replace('<span id="' + j + '"></span>', end_data[j])
 
                     include_plus_data += [[include_plus[0], include_data_set]]
 
-                    include = re.sub(', ?((?:(?!=).)+)=((?:(?!,).)+)', '', include, 1)
+                    include = re.sub(r', ?((?:(?!=).)+)=((?:(?!,).)+)', '', include, 1)
                 else:
                     break
 
@@ -614,21 +614,21 @@ def namumark(conn, data, title, include_num):
         else:
             break
 
-    data = re.sub('\r\n', '\n', data)
-    data = re.sub('&amp;', '&', data)
+    data = re.sub(r'\r\n', '\n', data)
+    data = re.sub(r'&amp;', '&', data)
 
-    data = re.sub('\n( +)\|\|', '\n||', data)
-    data = re.sub('\|\|( +)\n', '||\n', data)
+    data = re.sub(r'\n( +)\|\|', '\n||', data)
+    data = re.sub(r'\|\|( +)\n', '||\n', data)
 
-    data = re.sub('\n##(((?!\n).)+)', '', data)
-    data = re.sub('<div id="wiki_div" style="">\n', '<div id="wiki_div" style="">', data)
+    data = re.sub(r'\n##(((?!\n).)+)', '', data)
+    data = re.sub(r'<div id="wiki_div" style="">\n', '<div id="wiki_div" style="">', data)
 
     while 1:
-        wiki_table_data = re.search('<div id="wiki_div" ((?:(?!>).)+)>((?:(?!<div id="wiki_div"|<\/div_1>).\n*)+)<\/div_1>', data)
+        wiki_table_data = re.search(r'<div id="wiki_div" ((?:(?!>).)+)>((?:(?!<div id="wiki_div"|<\/div_1>).\n*)+)<\/div_1>', data)
         if wiki_table_data:
             wiki_table_data = wiki_table_data.groups()
-            if re.search('\|\|', wiki_table_data[1]):
-                end_parser = re.sub('\n$', '', re.sub('^\n', '', table_start('\n' + wiki_table_data[1] + '\n')))
+            if re.search(r'\|\|', wiki_table_data[1]):
+                end_parser = re.sub(r'\n$', '', re.sub(r'^\n', '', table_start('\n' + wiki_table_data[1] + '\n')))
             else:
                 end_parser = wiki_table_data[1]
 
@@ -641,13 +641,13 @@ def namumark(conn, data, title, include_num):
         else:
             break
 
-    data = re.sub('<\/div_2>', '</div>', data)
-    data = re.sub('<\/td>', '</td_1>', data)
+    data = re.sub(r'<\/div_2>', '</div>', data)
+    data = re.sub(r'<\/td>', '</td_1>', data)
 
     data += '\n'
     data = data.replace('\\', '&#92;')
 
-    redirect_re = re.compile('\n#(?:redirect|넘겨주기) ((?:(?!\n).)+)\n', re.I)
+    redirect_re = re.compile(r'\n#(?:redirect|넘겨주기) ((?:(?!\n).)+)\n', re.I)
     redirect = redirect_re.search(data)
     if redirect:
         redirect = redirect.group(1)
@@ -670,11 +670,11 @@ def namumark(conn, data, title, include_num):
             1
         )
 
-    no_toc_re = re.compile('\[(?:목차|toc)\((?:no)\)\]\n', re.I)
-    toc_re = re.compile('\[(?:목차|toc)\]', re.I)
+    no_toc_re = re.compile(r'\[(?:목차|toc)\((?:no)\)\]\n', re.I)
+    toc_re = re.compile(r'\[(?:목차|toc)\]', re.I)
     if not no_toc_re.search(data):
         if not toc_re.search(data):
-            data = re.sub('\n(?P<in>={1,6}) ?(?P<out>(?:(?!=).)+) ?={1,6}\n', '\n[toc]\n\g<in> \g<out> \g<in>\n', data, 1)
+            data = re.sub(r'\n(?P<in>={1,6}) ?(?P<out>(?:(?!=).)+) ?={1,6}\n', '\n[toc]\n\g<in> \g<out> \g<in>\n', data, 1)
     else:
         data = no_toc_re.sub('', data)
 
@@ -686,7 +686,7 @@ def namumark(conn, data, title, include_num):
     edit_number = 0
     toc_data = '<div id="toc"><span id="toc_title">TOC</span>\n\n'
     while 1:
-        toc = re.search('\n(={1,6}) ?((?:(?!\n).)+) ?(?:={1,6})\n', data)
+        toc = re.search(r'\n(={1,6}) ?((?:(?!\n).)+) ?(?:={1,6})\n', data)
         if toc:
             toc = toc.groups()
 
@@ -709,20 +709,20 @@ def namumark(conn, data, title, include_num):
                 all_stack += str(toc_stack[i]) + '.'
 
             while 1:
-                if re.search('[^0-9]0\.', all_stack):
-                    all_stack = re.sub('[^0-9]0\.', '.', all_stack)
+                if re.search(r'[^0-9]0\.', all_stack):
+                    all_stack = re.sub(r'[^0-9]0\.', '.', all_stack)
                 else:
                     break
 
-            all_stack = re.sub('^0\.', '', all_stack)
-            all_stack = re.sub('\.$', '', all_stack)
+            all_stack = re.sub(r'^0\.', '', all_stack)
+            all_stack = re.sub(r'\.$', '', all_stack)
 
-            new_toc_data = re.sub('=*$', '', toc[1])
-            new_toc_data = re.sub(' +$', '', new_toc_data)
-            if re.search('^# ?(?P<in>[^#]+) ?#$', new_toc_data):
+            new_toc_data = re.sub(r'=*$', '', toc[1])
+            new_toc_data = re.sub(r' +$', '', new_toc_data)
+            if re.search(r'^# ?(?P<in>[^#]+) ?#$', new_toc_data):
                 fol_head = '+'
 
-                new_toc_data = re.sub('^# ?(?P<in>[^#]+) ?#$', '\g<in>', new_toc_data)
+                new_toc_data = re.sub(r'^# ?(?P<in>[^#]+) ?#$', '\g<in>', new_toc_data)
             else:
                 fol_head = '-'
 
@@ -747,8 +747,8 @@ def namumark(conn, data, title, include_num):
             )
 
             toc_main_data = new_toc_data
-            toc_main_data = re.sub('\[\*((?:(?! |\]).)*)(?: ((?:(?!(\[\*(?:(?:(?!\]).)+)\]|\])).)+))?\]', '', toc_main_data)
-            toc_main_data = re.sub('<span id="math_[0-9]"><\/span>', '(Math)', toc_main_data)
+            toc_main_data = re.sub(r'\[\*((?:(?! |\]).)*)(?: ((?:(?!(\[\*(?:(?:(?!\]).)+)\]|\])).)+))?\]', '', toc_main_data)
+            toc_main_data = re.sub(r'<span id="math_[0-9]"><\/span>', '(Math)', toc_main_data)
 
             toc_data += '' + \
                 '<span style="margin-left: ' + str((toc_full - toc_top_stack) * 10) + 'px;">' + \
@@ -765,31 +765,31 @@ def namumark(conn, data, title, include_num):
     data = tool.savemark(data)
     
     now_time = tool.get_time()
-    time_data = re.search('^([0-9]{4}-[0-9]{2}-[0-9]{2})', now_time)
+    time_data = re.search(r'^([0-9]{4}-[0-9]{2}-[0-9]{2})', now_time)
     time = time_data.group(1)
     
-    macro_re = re.compile('\[([^[(]+)\(((?:(?!\)]).)+)\)\]')
+    macro_re = re.compile(r'\[([^[(]+)\(((?:(?!\)]).)+)\)\]')
     macro_data = macro_re.findall(data)
     for i in macro_data:
         macro_name = i[0].lower()
         if macro_name == 'youtube' or macro_name == 'kakaotv' or macro_name == 'nicovideo':
-            width = re.search(', ?width=((?:(?!,).)+)', i[1])
+            width = re.search(r', ?width=((?:(?!,).)+)', i[1])
             if width:
                 video_width = width.group(1)
-                if re.search('^[0-9]+$', video_width):
+                if re.search(r'^[0-9]+$', video_width):
                     video_width += 'px'
             else:
                 video_width = '560px'
 
-            height = re.search(', ?height=((?:(?!,).)+)', i[1])
+            height = re.search(r', ?height=((?:(?!,).)+)', i[1])
             if height:
                 video_height = height.group(1)
-                if re.search('^[0-9]+$', video_height):
+                if re.search(r'^[0-9]+$', video_height):
                     video_height += 'px'
             else:
                 video_height = '315px'
 
-            code = re.search('^((?:(?!,).)+)', i[1])
+            code = re.search(r'^((?:(?!,).)+)', i[1])
             if code:
                 video_code = code.group(1)
             else:
@@ -798,17 +798,17 @@ def namumark(conn, data, title, include_num):
             video_start = ''
 
             if macro_name == 'youtube':
-                start = re.search(', ?(start=(?:(?!,).)+)', i[1])
+                start = re.search(r', ?(start=(?:(?!,).)+)', i[1])
                 if start:
                     video_start = '?' + start.group(1)
 
-                video_code = re.sub('^https:\/\/www\.youtube\.com\/watch\?v=', '', video_code)
-                video_code = re.sub('^https:\/\/youtu\.be\/', '', video_code)
+                video_code = re.sub(r'^https:\/\/www\.youtube\.com\/watch\?v=', '', video_code)
+                video_code = re.sub(r'^https:\/\/youtu\.be\/', '', video_code)
 
                 video_src = 'https://www.youtube.com/embed/' + video_code
             elif macro_name == 'kakaotv':
-                video_code = re.sub('^https:\/\/tv\.kakao\.com\/channel\/9262\/cliplink\/', '', video_code)
-                video_code = re.sub('^http:\/\/tv\.kakao\.com\/v\/', '', video_code)
+                video_code = re.sub(r'^https:\/\/tv\.kakao\.com\/channel\/9262\/cliplink\/', '', video_code)
+                video_code = re.sub(r'^http:\/\/tv\.kakao\.com\/v\/', '', video_code)
 
                 video_src = 'https://tv.kakao.com/embed/player/cliplink/' + video_code +'?service=kakao_tv'
             else:
@@ -822,19 +822,19 @@ def namumark(conn, data, title, include_num):
         elif macro_name == 'anchor':
             data = macro_re.sub('<span id="' + i[1] + '"></span>', data, 1)
         elif macro_name == 'ruby':
-            ruby_code = re.search('^([^,]+)', i[1])
+            ruby_code = re.search(r'^([^,]+)', i[1])
             if ruby_code:
                 ruby_code = ruby_code.group(1)
             else:
                 ruby_code = 'Test'
 
-            ruby_top = re.search('ruby=([^,]+)', i[1], flags = re.I)
+            ruby_top = re.search(r'ruby=([^,]+)', i[1], flags = re.I)
             if ruby_top:
                 ruby_top = ruby_top.group(1)
             else:
                 ruby_top = 'Test'
 
-            ruby_color = re.search('color=([^,]+)', i[1], flags = re.I)
+            ruby_color = re.search(r'color=([^,]+)', i[1], flags = re.I)
             if ruby_color:
                 ruby_color = 'color: ' + ruby_color.group(1) + ';'
             else:
@@ -860,7 +860,7 @@ def namumark(conn, data, title, include_num):
                 if macro_name == 'age':
                     data = macro_re.sub(str(int(e_data.days / 365)), data, 1)
                 else:
-                    if re.search('^-', str(e_data.days)):
+                    if re.search(r'^-', str(e_data.days)):
                         e_day = str(e_data.days)
                     else:
                         e_day = '+' + str(e_data.days)
@@ -875,41 +875,41 @@ def namumark(conn, data, title, include_num):
     data = data.replace('<macro_middle>', '(')
     data = data.replace('<macro_end>', ')]')
 
-    if re.search('\[pagecount\]', data, flags = re.I):
+    if re.search(r'\[pagecount\]', data, flags = re.I):
         plus_data += 'page_count();\n'
-        data = re.sub('\[pagecount\]', '<span class="all_page_count"></span>', data, flags = re.I)
+        data = re.sub(r'\[pagecount\]', '<span class="all_page_count"></span>', data, flags = re.I)
 
-    data = re.sub('\[date\]', now_time, data, flags = re.I)
+    data = re.sub(r'\[date\]', now_time, data, flags = re.I)
 
     while 1:
-        block = re.search('(\n(?:&gt; ?(?:(?:(?!\n).)+)?\n)+)', data)
+        block = re.search(r'(\n(?:&gt; ?(?:(?:(?!\n).)+)?\n)+)', data)
         if block:
             block = block.group(1)
 
-            block = re.sub('^\n&gt; ?', '', block)
-            block = re.sub('\n&gt; ?', '\n', block)
-            block = re.sub('\n$', '', block)
+            block = re.sub(r'^\n&gt; ?', '', block)
+            block = re.sub(r'\n&gt; ?', '\n', block)
+            block = re.sub(r'\n$', '', block)
 
-            data = re.sub('(\n(?:&gt; ?(?:(?:(?!\n).)+)?\n)+)', '\n<blockquote>' + block + '</blockquote>\n', data, 1)
+            data = re.sub(r'(\n(?:&gt; ?(?:(?:(?!\n).)+)?\n)+)', '\n<blockquote>' + block + '</blockquote>\n', data, 1)
         else:
             break
 
     while 1:
-        hr = re.search('\n-{4,9}\n', data)
+        hr = re.search(r'\n-{4,9}\n', data)
         if hr:
-            data = re.sub('\n-{4,9}\n', '\n<hr>\n', data, 1)
+            data = re.sub(r'\n-{4,9}\n', '\n<hr>\n', data, 1)
         else:
             break
 
-    data = re.sub('(?P<in>\n +\* ?(?:(?:(?!\|\|).)+))\|\|', '\g<in>\n ||', data)
-    data = re.sub('(?P<in><div id="folding_(?:[0-9]+)" style="display: none;"><div style="">|<blockquote>)(?P<out> )?\* ', '\g<in>\n\g<out>* ', data)
+    data = re.sub(r'(?P<in>\n +\* ?(?:(?:(?!\|\|).)+))\|\|', '\g<in>\n ||', data)
+    data = re.sub(r'(?P<in><div id="folding_(?:[0-9]+)" style="display: none;"><div style="">|<blockquote>)(?P<out> )?\* ', '\g<in>\n\g<out>* ', data)
 
     while 1:
-        li = re.search('(\n(?:(?: *)\* ?(?:(?:(?!\n).)+)\n)+)', data)
+        li = re.search(r'(\n(?:(?: *)\* ?(?:(?:(?!\n).)+)\n)+)', data)
         if li:
             li = li.group(1)
             while 1:
-                sub_li = re.search('\n(?:( *)\* ?((?:(?!\n).)+))', li)
+                sub_li = re.search(r'\n(?:( *)\* ?((?:(?!\n).)+))', li)
                 if sub_li:
                     sub_li = sub_li.groups()
 
@@ -918,38 +918,38 @@ def namumark(conn, data, title, include_num):
                     else:
                         margin = len(sub_li[0]) * 20
 
-                    li = re.sub('\n(?:( *)\* ?((?:(?!\n).)+))', '<li style="margin-left: ' + str(margin) + 'px;">' + sub_li[1] + '</li>', li, 1)
+                    li = re.sub(r'\n(?:( *)\* ?((?:(?!\n).)+))', '<li style="margin-left: ' + str(margin) + 'px;">' + sub_li[1] + '</li>', li, 1)
                 else:
                     break
 
-            data = re.sub('(\n(?:(?: *)\* ?(?:(?:(?!\n).)+)\n)+)', '\n\n<ul>' + li + '</ul>\n', data, 1)
+            data = re.sub(r'(\n(?:(?: *)\* ?(?:(?:(?!\n).)+)\n)+)', '\n\n<ul>' + li + '</ul>\n', data, 1)
         else:
             break
 
-    data = re.sub('<\/ul>\n \|\|', '</ul>||', data)
-    data = re.sub('\|\|</blockquote>', '</blockquote>||', data)
+    data = re.sub(r'<\/ul>\n \|\|', '</ul>||', data)
+    data = re.sub(r'\|\|</blockquote>', '</blockquote>||', data)
 
     while 1:
-        indent = re.search('\n( +)', data)
+        indent = re.search(r'\n( +)', data)
         if indent:
             indent = len(indent.group(1))
 
             margin = '<span style="margin-left: 20px;"></span>' * indent
 
-            data = re.sub('\n( +)', '\n' + margin, data, 1)
+            data = re.sub(r'\n( +)', '\n' + margin, data, 1)
         else:
             break
 
     data = table_start(data)
 
     category = ''
-    category_re = re.compile('^(?:category|분류):', re.I)
+    category_re = re.compile(r'^(?:category|분류):', re.I)
     while 1:
-        link = re.search('\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', data)
+        link = re.search(r'\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', data)
         if link:
             link = link.group(1)
 
-            link_split = re.search('((?:(?!\|).)+)(?:\|((?:(?!\|).)+))', link)
+            link_split = re.search(r'((?:(?!\|).)+)(?:\|((?:(?!\|).)+))', link)
             if link_split:
                 link_split = link_split.groups()
 
@@ -959,26 +959,26 @@ def namumark(conn, data, title, include_num):
                 main_link = link
                 see_link = link
 
-            if re.search('^((?:file|파일)|(?:out|외부)):', main_link):
+            if re.search(r'^((?:file|파일)|(?:out|외부)):', main_link):
                 file_style = ''
 
-                file_width = re.search('width=((?:(?!&).)+)', see_link)
+                file_width = re.search(r'width=((?:(?!&).)+)', see_link)
                 if file_width:
                     file_width = file_width.group(1)
-                    if re.search('px$', file_width):
+                    if re.search(r'px$', file_width):
                         file_style += 'width: ' + file_width + ';'
                     else:
                         file_style += 'width: ' + file_width + 'px;'
 
-                file_height = re.search('height=((?:(?!&).)+)', see_link)
+                file_height = re.search(r'height=((?:(?!&).)+)', see_link)
                 if file_height:
                     file_height = file_height.group(1)
-                    if re.search('px$', file_height):
+                    if re.search(r'px$', file_height):
                         file_style += 'height: ' + file_height + ';'
                     else:
                         file_style += 'height: ' + file_height + 'px;'
 
-                file_align = re.search('align=((?:(?!&).)+)', see_link)
+                file_align = re.search(r'align=((?:(?!&).)+)', see_link)
                 if file_align:
                     file_align = file_align.group(1)
                     if file_align == 'center':
@@ -988,19 +988,19 @@ def namumark(conn, data, title, include_num):
                 else:
                     file_align = ''
 
-                file_color = re.search('bgcolor=((?:(?!&).)+)', see_link)
+                file_color = re.search(r'bgcolor=((?:(?!&).)+)', see_link)
                 if file_color:
                     file_color = 'background: ' + file_color.group(1) + '; display: inline-block;'
                 else:
                     file_color = ''
 
-                if re.search('^(?:out|외부):', main_link):
-                    file_src = re.sub('^(?:out|외부):', '', main_link)
+                if re.search(r'^(?:out|외부):', main_link):
+                    file_src = re.sub(r'^(?:out|외부):', '', main_link)
 
                     file_alt = main_link
                     exist = 'Yes'
                 else:
-                    file_data = re.search('^(?:file|파일):((?:(?!\.).)+)\.(.+)$', main_link)
+                    file_data = re.search(r'^(?:file|파일):((?:(?!\.).)+)\.(.+)$', main_link)
                     if file_data:
                         file_data = file_data.groups()
                         file_name = file_data[0]
@@ -1047,7 +1047,7 @@ def namumark(conn, data, title, include_num):
                 link_id = ''
 
                 curs.execute(tool.db_change("select title from data where title = ?"), [main_link])
-                if re.search('#blur', main_link):
+                if re.search(r'#blur', main_link):
                     link_id = ' hidden_link'
                     main_link = main_link.replace('#blur', '')
                     see_link = see_link.replace('#blur', '')
@@ -1055,16 +1055,16 @@ def namumark(conn, data, title, include_num):
                 backlink += [[title, main_link, 'cat']]
                 category += '<a class="' + include_num + 'link_finder' + link_id + '" href="/w/' + tool.url_pas(main_link) + '">' + category_re.sub('', see_link) + '</a> | '
 
-                data = re.sub('\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', '', data, 1)
-            elif re.search('^wiki:', main_link):
+                data = re.sub(r'\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', '', data, 1)
+            elif re.search(r'^wiki:', main_link):
                 data = re.sub(
                     '\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]',
                     '<a id="inside" href="/' + tool.url_pas(re.sub('^wiki:', '', main_link)) + '">' + see_link + '</a>',
                     data,
                     1
                 )
-            elif re.search('^inter:((?:(?!:).)+):', main_link):
-                inter_data = re.search('^inter:((?:(?!:).)+):((?:(?!\]\]|\|).)+)', main_link)
+            elif re.search(r'^inter:((?:(?!:).)+):', main_link):
+                inter_data = re.search(r'^inter:((?:(?!:).)+):((?:(?!\]\]|\|).)+)', main_link)
                 inter_data = inter_data.groups()
 
                 curs.execute(tool.db_change('select link, icon from inter where title = ?'), [inter_data[0]])
@@ -1090,30 +1090,30 @@ def namumark(conn, data, title, include_num):
                             1
                         )
                 else:
-                    data = re.sub('\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', 'Not exist', data, 1)
-            elif re.search('^(\/(?:.+))$', main_link):
-                under_title = re.search('^(\/(?:.+))$', main_link)
+                    data = re.sub(r'\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', 'Not exist', data, 1)
+            elif re.search(r'^(\/(?:.+))$', main_link):
+                under_title = re.search(r'^(\/(?:.+))$', main_link)
                 under_title = under_title.group(1)
 
                 if see_link != main_link:
-                    data = re.sub('\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', '[[' + title + under_title + '|' + see_link + ']]', data, 1)
+                    data = re.sub(r'\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', '[[' + title + under_title + '|' + see_link + ']]', data, 1)
                 else:
-                    data = re.sub('\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', '[[' + title + under_title + ']]', data, 1)
-            elif re.search('^http(s)?:\/\/', main_link):
-                data = re.sub('\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', '<a id="out_link" rel="nofollow" href="' + main_link + '">' + see_link + '</a>', data, 1)
+                    data = re.sub(r'\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', '[[' + title + under_title + ']]', data, 1)
+            elif re.search(r'^http(s)?:\/\/', main_link):
+                data = re.sub(r'\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', '<a id="out_link" rel="nofollow" href="' + main_link + '">' + see_link + '</a>', data, 1)
             else:
                 return_link = link_fix(main_link)
                 main_link = html.unescape(return_link[0])
                 other_link = return_link[1]
 
-                if re.search('^\/', main_link):
-                    main_link = re.sub('^\/', title + '/', main_link)
-                elif re.search('\.\.\/\/', main_link):
-                    main_link = re.sub('\.\.\/\/', '/', main_link)
-                elif re.search('^\.\.\/', main_link):
-                    main_link = re.sub('^\.\.\/', re.sub('(?P<in>.+)\/.*$', '\g<in>', title), main_link)
+                if re.search(r'^\/', main_link):
+                    main_link = re.sub(r'^\/', title + '/', main_link)
+                elif re.search(r'\.\.\/\/', main_link):
+                    main_link = re.sub(r'\.\.\/\/', '/', main_link)
+                elif re.search(r'^\.\.\/', main_link):
+                    main_link = re.sub(r'^\.\.\/', re.sub(r'(?P<in>.+)\/.*$', '\g<in>', title), main_link)
 
-                if not re.search('^\|', main_link):
+                if not re.search(r'^\|', main_link):
                     if main_link != title:
                         if main_link != '':
                             backlink += [[title, main_link, '']]
@@ -1139,7 +1139,7 @@ def namumark(conn, data, title, include_num):
                                 1
                             )
                     else:
-                        if re.search('^#', other_link):
+                        if re.search(r'^#', other_link):
                             data = re.sub(
                                 '\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]',
                                 '<a title="' + other_link + '" href="' + other_link + '">' + other_link + '</a>',
@@ -1147,13 +1147,13 @@ def namumark(conn, data, title, include_num):
                                 1
                             )
                         else:
-                            data = re.sub('\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', '<b>' + see_link + '</b>', data, 1)
+                            data = re.sub(r'\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', '<b>' + see_link + '</b>', data, 1)
                 else:
-                    data = re.sub('\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', '&#91;&#91;' + link + '&#93;&#93;', data, 1)
+                    data = re.sub(r'\[\[((?:(?!\[\[|\]\]|<\/td>).)+)\]\]', '&#91;&#91;' + link + '&#93;&#93;', data, 1)
         else:
             break
 
-    br_re = re.compile('\[br\]', re.I)
+    br_re = re.compile(r'\[br\]', re.I)
     data = br_re.sub('<br>', data)
 
     footnote_number = 0
@@ -1164,7 +1164,7 @@ def namumark(conn, data, title, include_num):
 
     footdata_all = '<hr><ul id="footnote_data">'
 
-    re_footnote = re.compile('(?:\[\*((?:(?! |\]).)*)(?: ((?:(?!(?:\[\*|\])).)+))?\]|(\[(?:각주|footnote)\]))')
+    re_footnote = re.compile(r'(?:\[\*((?:(?! |\]).)*)(?: ((?:(?!(?:\[\*|\])).)+))?\]|(\[(?:각주|footnote)\]))')
     while 1:
         footnote = re_footnote.search(data)
         if footnote:
@@ -1242,7 +1242,7 @@ def namumark(conn, data, title, include_num):
         else:
             break
 
-    data = re.sub('\n+$', '', data)
+    data = re.sub(r'\n+$', '', data)
 
     footnote_all.sort()
 
@@ -1267,35 +1267,35 @@ def namumark(conn, data, title, include_num):
     if footdata_all == '</div><hr><ul id="footnote_data"></ul>':
         footdata_all = '</div>'
 
-    data = re.sub('\n$', footdata_all, data + '\n', 1)
+    data = re.sub(r'\n$', footdata_all, data + '\n', 1)
 
-    data = re.sub('&#x27;&#x27;&#x27;(?P<in>((?!&#x27;&#x27;&#x27;).)+)&#x27;&#x27;&#x27;', '<b>\g<in></b>', data)
-    data = re.sub('&#x27;&#x27;(?P<in>((?!&#x27;&#x27;).)+)&#x27;&#x27;', '<i>\g<in></i>', data)
-    data = re.sub('~~(?P<in>(?:(?!~~).)+)~~', '<s>\g<in></s>', data)
-    data = re.sub('--(?P<in>(?:(?!--).)+)--', '<s>\g<in></s>', data)
-    data = re.sub('__(?P<in>(?:(?!__).)+)__', '<u>\g<in></u>', data)
-    data = re.sub('\^\^(?P<in>(?:(?!\^\^).)+)\^\^', '<sup>\g<in></sup>', data)
-    data = re.sub(',,(?P<in>(?:(?!,,).)+),,', '<sub>\g<in></sub>', data)
+    data = re.sub(r'&#x27;&#x27;&#x27;(?P<in>((?!&#x27;&#x27;&#x27;).)+)&#x27;&#x27;&#x27;', '<b>\g<in></b>', data)
+    data = re.sub(r'&#x27;&#x27;(?P<in>((?!&#x27;&#x27;).)+)&#x27;&#x27;', '<i>\g<in></i>', data)
+    data = re.sub(r'~~(?P<in>(?:(?!~~).)+)~~', '<s>\g<in></s>', data)
+    data = re.sub(r'--(?P<in>(?:(?!--).)+)--', '<s>\g<in></s>', data)
+    data = re.sub(r'__(?P<in>(?:(?!__).)+)__', '<u>\g<in></u>', data)
+    data = re.sub(r'\^\^(?P<in>(?:(?!\^\^).)+)\^\^', '<sup>\g<in></sup>', data)
+    data = re.sub(r',,(?P<in>(?:(?!,,).)+),,', '<sub>\g<in></sub>', data)
 
     if category != '':
-        category = re.sub(' \| $', '', category) + '</div></div>'
+        category = re.sub(r' \| $', '', category) + '</div></div>'
 
     data += category
 
-    data = re.sub('<\/td_1>', '</td>', data)
-    data = re.sub('<\/ul>\n?', '</ul>', data)
-    data = re.sub('<\/pre>\n?', '</pre>', data)
-    data = re.sub('(?P<in><div class="all_in_data"(?:(?:(?!id=).)+)? id="in_data_([^"]+)">)(\n)+', '\g<in>', data)
-    data = re.sub('\n\n<ul>', '\n<ul>', data)
-    data = re.sub('<\/ul>\n\n', '</ul>', data)
-    data = re.sub('^(\n)+', '', data)
-    data = re.sub('(\n)+<hr><ul id="footnote_data">', '<hr><ul id="footnote_data">', data)
-    data = re.sub('(?P<in><td(((?!>).)*)>)\n', '\g<in>', data)
-    data = re.sub('(\n)?<hr>(\n)?', '<hr>', data)
-    data = re.sub('<\/ul>\n\n<ul>', '</ul>\n<ul>', data)
-    data = re.sub('<\/ul>\n<ul>', '</ul><ul>', data)
-    data = re.sub('\n<\/ul>', '</ul>', data)
-    data = re.sub('\n', '<br>', data)
+    data = re.sub(r'<\/td_1>', '</td>', data)
+    data = re.sub(r'<\/ul>\n?', '</ul>', data)
+    data = re.sub(r'<\/pre>\n?', '</pre>', data)
+    data = re.sub(r'(?P<in><div class="all_in_data"(?:(?:(?!id=).)+)? id="in_data_([^"]+)">)(\n)+', '\g<in>', data)
+    data = re.sub(r'\n\n<ul>', '\n<ul>', data)
+    data = re.sub(r'<\/ul>\n\n', '</ul>', data)
+    data = re.sub(r'^(\n)+', '', data)
+    data = re.sub(r'(\n)+<hr><ul id="footnote_data">', '<hr><ul id="footnote_data">', data)
+    data = re.sub(r'(?P<in><td(((?!>).)*)>)\n', '\g<in>', data)
+    data = re.sub(r'(\n)?<hr>(\n)?', '<hr>', data)
+    data = re.sub(r'<\/ul>\n\n<ul>', '</ul>\n<ul>', data)
+    data = re.sub(r'<\/ul>\n<ul>', '</ul><ul>', data)
+    data = re.sub(r'\n<\/ul>', '</ul>', data)
+    data = re.sub(r'\n', '<br>', data)
 
     plus_data = 'render_html("' + include_num + 'render_contect");\n' + plus_data
 

+ 2 - 2
route/topic.py

@@ -41,7 +41,7 @@ def topic_2(conn, topic_num):
 
         num = str(num)
 
-        match = re.search('^user:([^/]+)', name)
+        match = re.search(r'^user:([^/]+)', name)
         if match:
             y_check = 0
             if ip_or_user(match.group(1)) == 1:
@@ -67,7 +67,7 @@ def topic_2(conn, topic_num):
                     today
                 ])
 
-        cate_re = re.compile('\[\[((?:분류|category):(?:(?:(?!\]\]).)*))\]\]', re.I)
+        cate_re = re.compile(r'\[\[((?:분류|category):(?:(?:(?!\]\]).)*))\]\]', re.I)
         data = cate_re.sub('[br]', flask.request.form.get('content', 'Test'))
 
         for rd_data in re.findall("(?:#([0-9]+))", data):

+ 1 - 1
route/topic_close_list.py

@@ -73,7 +73,7 @@ def topic_close_list_2(conn, name):
         '''
 
     if div == '':
-        plus = re.sub('^<br>', '', plus)
+        plus = re.sub(r'^<br>', '', plus)
 
     return easy_minify(flask.render_template(skin_check(),
         imp = [name, wiki_set(), custom(), other2([' (' + sub + ')', 0])],

+ 6 - 6
route/view_diff_data.py

@@ -33,19 +33,19 @@ def view_diff_data_2(conn, name):
                 diff_data = diff_match_patch().diff_prettyHtml(diff_match_patch().diff_main(first_raw_data, second_raw_data))
                 end_data = ''
 
-                re_data = re.findall('(?:(?:(?:(?!&para;<br>).)*)(?:&para;<br>)|(?:(?:(?!&para;<br>).)+)$)', diff_data)
+                re_data = re.findall(r'(?:(?:(?:(?!&para;<br>).)*)(?:&para;<br>)|(?:(?:(?!&para;<br>).)+)$)', diff_data)
                 for re_in_data in re_data:
-                    re_in_data = re.sub('&para;<br>$', '', re_in_data)
-                    if re.search('<ins (((?!<\/ins>).)+)<\/ins>', re_in_data):
+                    re_in_data = re.sub(r'&para;<br>$', '', re_in_data)
+                    if re.search(r'<ins (((?!<\/ins>).)+)<\/ins>', re_in_data):
                         end_data += str(i) + ' : ' + re_in_data + '\n'
                         include_ins = 0
-                    elif re.search('(<ins |<del )', re_in_data) and re.search('(<\/ins>|<\/del>)', re_in_data):
+                    elif re.search(r'(<ins |<del )', re_in_data) and re.search(r'(<\/ins>|<\/del>)', re_in_data):
                         end_data += str(i) + ' : ' + re_in_data + '\n'
                         include_ins = 1
-                    elif re.search('(<\/ins>|<\/del>)', re_in_data):
+                    elif re.search(r'(<\/ins>|<\/del>)', re_in_data):
                         end_data += str(i) + ' : ' + re_in_data + '\n'
                         include_ins = 0
-                    elif re.search('(<ins |<del )', re_in_data) or include_ins == 1:
+                    elif re.search(r'(<ins |<del )', re_in_data) or include_ins == 1:
                         end_data += str(i) + ' : ' + re_in_data + '\n'
                         include_ins = 1
                     else:

+ 4 - 4
route/view_read.py

@@ -36,7 +36,7 @@ def view_read_2(conn, name):
     else:
         uppage = 0
 
-    if re.search('^category:', name):
+    if re.search(r'^category:', name):
         curs.execute(db_change("select link from back where title = ? and type = 'cat' order by link asc"), [name])
         back = curs.fetchall()
         if back:
@@ -46,7 +46,7 @@ def view_read_2(conn, name):
                 if div == '':
                     div = '<br><h2 id="cate_normal">' + load_lang('category_title') + '</h2><ul>'
 
-                if re.search('^category:', data[0]):
+                if re.search(r'^category:', data[0]):
                     u_div += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a></li>'
                 else:
                     curs.execute(db_change("select title from back where title = ? and type = 'include'"), [data[0]])
@@ -91,8 +91,8 @@ def view_read_2(conn, name):
             else_data = None
 
         if flask.request.args.get('from', None) and else_data:
-            else_data = re.sub('^\r\n', '', else_data)
-            else_data = re.sub('\r\n$', '', else_data)
+            else_data = re.sub(r'^\r\n', '', else_data)
+            else_data = re.sub(r'\r\n$', '', else_data)
 
         end_data = render_set(
             title = name,