The regular expression you wrote is correct. Is there a problem with your Chinese character encoding? I have written a complete program in C Sharp for you. There is no problem with Chinese display.
using?System;using?System.Collections.Generic;
using?System. Linq;
using?System.Text;
< p>using?System.Text.RegularExpressions;namespace?ConsoleApplication3
{
class?Program
{
static?void?Main(string[]?args)
{
string?s?=?"[1]Zhang Xiaoqing. Lightning protection and grounding of wind turbines.[M] China Electric Power Press, Beijing, 2009.\n[2]Wang Liguang Protection against wind turbine lightning[D]. Hunan CSR Zhuzhou Electric Locomotive Research Institute, 2008.?\n[3]Kang Chunhua, Zhang Xiaoqing, Wang Fang. Wind turbine lightning protection problems[D]. new energy from Jiaotong Universityof Beijing, Beijing, 2006.?\n[4] Lin Zhiyuan, Huang Cong. Wind turbine lightning protection problems [D]. . Guangdong Electric Power, 2001,14(5)15-18.?\n[5]Li Jinglu. Discussion on the application of resistance reducing agent in grounding engineering[D]. [6]Li Yilun. VESTAS from the Netherlands Lightning protection for wind turbines[D]. Inner Mongolia Wind Power Corporation, 1999.?\n";
Regex?r?=?new?Regex(" ](? MatchCollection?matches?= ?r.Matches(s); for?(int?i?=?0;?i?<? matches.Count;i++) {
{
Console.WriteLine( matches[i].Groups["name "].Value);
Console.WriteLine(matches[i].Groups["title"].Value);
Console.WriteLine(matches[i].Groups["where"].Value); p>
Console.WriteLine(matches[i].Groups["where"].Value);
Console.WriteLine(matches[i].Groups ["date"].Value);
}
>
Console.ReadKey();
>
>
>