要验证印度车辆否 [英] want to validate indian vehicle no
本文介绍了要验证印度车辆否的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人
我想在asp.net中验证印度车辆是否不使用RegularExpressionValidator
如果可行,请还原
谢谢...
Dear All
I want to validate indian vehicle No Using RegularExpressionValidator in asp.net
If it is pssible please revert
thanks...
推荐答案
如果要构建RegEx字符串,可以使用以下工具开始: http://gskinner.com/RegExr/ [ ^ ].
如果可以正常工作,您可以立即在这里尝试并测试您的正则表达式.
只是一个起点.
希望这会有所帮助.
最好的问候,
Stops
Hi,
If you want to build a RegEx string, you could start by using the following tool: http://gskinner.com/RegExr/[^].
There, you can instantly try and test your regex, if it is working correctly.
Just as a starting point.
Hope this helps.
Best regards,
Stops
根据 Wiki [ ^ ]:
Indian number plate format is quite simple according to Wiki[^]:
The first two letters of the registration plate represent the State in which the vehicle is Registered.
The next two digit numbers are the sequential number of a district. Due to heavy volume of vehicle registration, the numbers were given to the RTO offices of registration as well.
The third part is a 4 digit number unique to each plate. A letter(s) is prefixed when the 4 digit number runs out and then two letters and so on.
您可以在Rexeg中执行简单的哑"验证,但您可能想使其更加复杂,以检查状态码-我不知道它们可以是什么.
You can do a simple "dumb" validation in a Rexeg, but you might want to make it a bit more complex, to check state codes - I have no idea what they can be.
public static Regex regex = new Regex(
"(?<state>\\w\\w)(?<sequence>\\d\\d(?<unique>\\w*\\d\\d\\d\\d"+
"))",
RegexOptions.IgnoreCase
| RegexOptions.Singleline
| RegexOptions.CultureInvariant
| RegexOptions.Compiled
);</unique></sequence></state>
这是假设您不想检查该号码是否确实已发出-这是另一个问题!
获取 Expresso [ ^ ]-它是免费的,它可以检查并生成正则表达式.
This assumes you do not want to check if the number is actually issued - that is a whole other problem!
Get a copy of Expresso [^] - it''s free, and it examines and generates Regular expressions.
我不认为印度有一个车辆编号的确切格式.它因州而异,据我所知,并非所有州都遵循相同的格式.如果您知道这些格式的认可格式,请告诉我
I dont think that India has an exact format for vehicle numbers. Its differing from state to state and as far as I know its not all the states following same format. If you have a known approved format for those please let me know
这篇关于要验证印度车辆否的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文