Element Picker (C#, Regular Expression)
来源:互联网 发布:游戏美工需要什么软件 编辑:程序博客网 时间:2024/05/29 02:27
The following code picks element from a text file according to the pattern specified.
It is first used in collecting source file names from a vc project file in order to list them in a common makefile.
It is first used in collecting source file names from a vc project file in order to list them in a common makefile.
- using System.IO;
- using System.Text;
- using System;
- using System.Text.RegularExpressions;
- namespace Picker
- {
- public class Program
- {
- public static void Main(String[] args)
- {
- StreamReader sr = null;
- String pattern = "";
- if (args.Length >= 2)
- {
- sr = new StreamReader(args[0]);
- pattern = args[1];
- }
- else
- {
- Console.WriteLine("! Not enough arguments.");
- return;
- }
- String s = sr.ReadToEnd();
- sr.Close();
- MatchCollection matches = Regex.Matches(s, pattern);
- foreach (Match match in matches)
- {
- Console.WriteLine(match.ToString());
- }
- Console.WriteLine(": Searching finished with " + matches.Count + " matches.");
- }
- }
- }
- Element Picker (C#, Regular Expression)
- Regular Expression 正则表达式-1 (C#)
- Regular Expression 正则表达式-3 (C++)
- Regular Expression 正则表达式-4 (C++)
- Regular Expression 正则表达式-1 (C#)
- Linux c regular expression (转载)
- [leetcode-10]Regular Expression Matching(C)
- regular expression
- Regular Expression
- regular expression
- Regular Expression
- Regular Expression
- regular expression
- Regular Expression
- Regular Expression
- regular expression
- Regular expression
- Regular Expression
- 删除部分浏览器为图片添加的默认边框
- Linux主题 -- 待阅读或测试
- 关于CRC校验
- 拖动数据到div
- Ethereal协议分析系统介绍
- Element Picker (C#, Regular Expression)
- 拖动滚动条时,背景图片随之滚动
- Get your spatial datasets clean...
- Comparing Formats(Comparing with other data formats)学习笔记
- Spring中bean的作用域
- 我该使用何种语言
- spring中配置不可见的数据源连接方式!
- 利用模板类编写一个程序,实现双向链表的插入、删除、查找、显示的功能。
- 从程序结果分析对象上转型