Skip to main content
 首页 » 编程设计

c#之字符串模式查找字符

2024年02月13日20mq0036

我的文本文件是这样格式化的;

ID: 300000000 NAME: 3rd: Ellin Forest: Altaire Camp 
ID: 300000100 NAME: 3rd: Altaire Camp: Small Forest 
ID: 687000000 NAME: Gacha_GL: Gacha: Gachapon 
ID: 682000000 NAME: HalloweenGL: Phantom Forest: Haunted House 

请您参考如下方法:

在正则表达式中包含缓冲区部分:

ID: (?<id>\d*) NAME: (?<buffer>.*?:) (?<name>.*)