正则表达式问题

leonwan 2007-05-20 03:16:53
怎样构造match表达式

string input = "人民";

string match = "人民币,数字"


try
{
Match m = Regex.Match(input, match, RegexOptions.IgnoreCase);

if (m.Success)
{
MessageBox.Show("验证通过!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (Exception ex)
{
MessageBox.Show("info"+ex.ToString(),"提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
return;
}
...全文
241 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
l444333 2007-05-20
  • 打赏
  • 举报
回复
string match = "(人民(币)?|(数字))";
leonwan 2007-05-20
  • 打赏
  • 举报
回复
现在的表达式是无法匹配成功。我的意思是怎样构造string match = "人民币,数字"才能匹配成功。
impeller 2007-05-20
  • 打赏
  • 举报
回复
你都写出来了

111,098

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧