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;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
671 次 |
| 最近记录: |