gpt4 book ai didi

c# - 什么是 PHP 的 preg_quote 的等价物?

转载 作者:太空狗 更新时间:2023-10-29 23:01:48 24 4
gpt4 key购买 nike

PHP 的preg_quote 等价于什么? ?

这是我创建一个从字符串中提取文本的方法所得到的:

    public static string f_get_string_between(string text, string start, string end)
{
//both these attempts below throw an unrecognized escape sequence error
//start = "\Q"+start+"\E";
//end = "\Q"+end+"\E";

Regex regex = new Regex(start + "(.*?)" + end);
var v = regex.Match(text);
text = v.Groups[1].ToString();
return text;
}

最佳答案

关于c# - 什么是 PHP 的 preg_quote 的等价物?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9235311/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com