Add tags

Add tags to the following comment
一番乗りかな? 正規表現は自信が無いので、あってるか不安。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 -*- coding: utf-8 -*-
import re

def remove_comment(comment):
    print re.sub(r'/\*.*?((\*/)|($))','',comment, re.M)

remove_comment('AAA')
remove_comment('AAA/*BBB*/')
remove_comment('AAA/*BBB')
remove_comment('AAA/*BBB*/CCC')
remove_comment('AAA/*BBB/*CCC*/DDD*/EEE')
remove_comment('AAA/a//*BB*B**/CCC')

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...