regex expression to replace a string
I need to replace any ch开发者_如何学Caracters in the set...
[]*?/\:
with an empty string. Can someone post how this is done?
Depends on the language you are using; but you could use (with sed)
sed -e "s/\[\]\*\?\/\\\://g" filename
For C#
Regex.Replace(input, @"[\[\\\]*?/:]", string.Empty)
Perl: $str =~ s/.//g;
But I think you mean replacement with a Space: $str =~ s/./ /g;
For Javascript
var s = "he[ll]o? \*/ foo:bar";
var replaced = s.replace(/[[\\\]*?/:]/g, "");
?replaced
>>hello foobar
精彩评论