开发者

VB.Net Regular Expressions - Escape Method

开发者 https://www.devze.com 2023-03-17 11:03 出处:网络
Is there a way t开发者_开发知识库o escape all metacharacters in a string with the exception of \"*\"?You can call Regex.Escape(str).Replace(\"\\*\", \"*\").

Is there a way t开发者_开发知识库o escape all metacharacters in a string with the exception of "*"?


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消