2

I need to replace any characters in the set...

[]*?/\:

with an empty string. Can someone post how this is done?

1
  • btw, I am using C# Regex object Commented May 4, 2011 at 14:44

4 Answers 4

2

Depends on the language you are using; but you could use (with sed)

sed -e "s/\[\]\*\?\/\\\://g" filename
Sign up to request clarification or add additional context in comments.

Comments

1

For C#

Regex.Replace(input, @"[\[\\\]*?/:]", string.Empty)

Comments

0

Perl: $str =~ s/.//g;

But I think you mean replacement with a Space: $str =~ s/./ /g;

Comments

0

For Javascript

var s = "he[ll]o? \*/ foo:bar";
var replaced = s.replace(/[[\\\]*?/:]/g, "");

?replaced
>>hello  foobar

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.