简体   繁体   English

需要正则表达式匹配模式

[英]Need Regex match pattern

I have a string which i need to parse using Regex class of System.Text.RegularExpressions . 我有一个字符串,我需要使用System.Text.RegularExpressions Regex类进行解析。 I need to find if the first 2 characters of the string are either "00" or "07" or "16" or "23". 我需要查找字符串的前2个字符是“ 00”还是“ 07”或“ 16”或“ 23”。 Please let me know as what the pattern would be to match the above. 请让我知道匹配上面的模式。

You could do: 您可以这样做:

^(00|07|16|23).*

As seen on rubular 如在ruular看到的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM