首页
极刻
圈子
教程
开源
登录 / 注册
返回教程:C# 教程
TRY RUN / 在线示例
C# 教程 运行实例
C# 教程 运行实例
源代码
运行
using System; using System.Text.RegularExpressions; public class Example { public static void Main() { string input = "1851 1999 1950 1905 2003"; string pattern = @"(?<=19)\d{2}\b"; foreach (Match match in Regex.Matches(input, pattern)) Console.WriteLine(match.Value); } }
运行结果
<html><head></head><body>99<br>50<br>05<br></body></html>