如何使用示例在vb中使用正则表达式创建日期格式 [英] how to create a date format with regular expression in vb with example
本文介绍了如何使用示例在vb中使用正则表达式创建日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
8/11/13我想用vb.net中的正则表达式创建这个日期plzzzz任何人帮助我我无法理解这个plzzz
8/11/13 i want to create this date with regular expression in vb.net plzzzz anyone help me i cant understand this plzzz
推荐答案
不要。
您可以编写一个正则表达式来验证日期: http://www.regular-expressions .info / dates.html [ ^ ] ...但这对于问题来说是一个糟糕的解决方案。
相反,使用 DateTime.TryParseExact [ ^ ]这样更容易阅读,甚至可以将其转换为DateTime值供您使用将来!
Don't.
You can write a regex to validate a date: http://www.regular-expressions.info/dates.html[^]...but it's a poor solution to teh problem.
Instead, use DateTime.TryParseExact[^] which is a lot easier to read, and even converts it to a DateTime value for you to use in future!
这篇关于如何使用示例在vb中使用正则表达式创建日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文