Add tags

Add tags to the following comment

Python使いがJavaScriptを使ってつまづいたのは、Pythonと同じように文字列にreplaceメソッドがあるけどもこれは置換するのが1つだけだという点。正規表現にgをつけて使うのが正解。

1
2
3
4
5
6
7
8
>>> "2007-10-30".replace("-", "/") # not replace all
"2007/10-30"
>>> "2007-10-30".replace(/-/g, "/")
"2007/10/30"
>>> "2007-10-30".replace("\d+", "*") # considered as string
"2007-10-30"
>>> "2007-10-30".replace(/\d+/g, "*")
"*-*-*"

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...