开发者

Visual Studio Regular Expressions - Matching first word in a file

Is it possible to match the first word in a file using Visual Studio Regex?

e.g. ^using matches 开发者_开发百科multiple statements where "using" matches the first five characters on a line.

I need to find and replace the only first using statement where "using" matches the first five characters in the file.

Thanks,

M


Well, regex matches against a string. So, you could try reading the first line of the file into a string and execute a regex match against that string.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜