Walker
Walker

Reputation: 5199

VB.Net Regular Expressions - Escape Method

Is there a way to escape all metacharacters in a string with the exception of "*"?

Upvotes: 0

Views: 749

Answers (1)

SLaks
SLaks

Reputation: 887777

You can call Regex.Escape(str).Replace("\*", "*").

If the original string contains \*, this won't work properly.

Upvotes: 2

Related Questions