Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Number of characters for license plate
Message
De
26/03/2013 09:51:53
 
 
À
26/03/2013 08:58:30
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01569207
Message ID:
01569245
Vues:
28
>>>>We have an application which negotiates with license plates. It is focused to be international. It currently supports Canada, United States and another country. I would like to know how many characters you are usually reserving for such a field in your application knowing that it could be used to store license plates from all over the world.
>>>
>>>Well - http://en.wikipedia.org/wiki/European_vehicle_registration_plates#Common_letter_and_digit_systems_between_countries
>>>
>>>If you *know* the country that the car is registered in then I suppose it would be possible to build up a Regex library with one or more entries for each country.
>>>
>>>Don't see a country in Europe listed that has more than 8 letters/digits. Don't recall seeing anything longer in non-European countries...
>>
>>I like the regex idea - and the patterns will need changing as-you-go, ie start with a few countries and expand. Keeps one busy
>>
>>Also, the format may change in some country over time
>>You need at least the country of registration - maybe the state as well - and the country (via the language set) should give you LTR or RTL reading order
>>
>>
>>I'd start with nvarchar(16) - maybe even nvarchar(12) - should be sufficient and the length can be changed over time
>>
>>ps: I would not volunteer to write the regex patters for arabic, chinese, japanese
>
>:-}
>Regex for Kanji - wouldn't know where to start....


On second thought ...

Isn't Kanji Japanese ?

The advantage of Net Regex is that it has a pattern for letter, uppercase letter and lowercase letter

Pattern below matches a letter
Input = two japanese chars + 1 westeren Ė


It matches each char - but the first two don't display very well in the Console.WriteLine()
		static void Main()
		{
			// \p{L}	matches a letter
			// \p{Lu}	matches an uppercase letter
			// \p{Ll}	matches an lowercase letter

			// first two chars: from here  http://msdn.microsoft.com/en-us/goglobal/gg638602
			// Last  char Ė
			string s = "\u3093\u304D\u00C9";	//
			MatchCollection  matches = Regex.Matches(s, @"\p{L}");
			foreach (Match m in matches)
					Console.WriteLine("{0}", m.Value);
			Console.ReadLine();

		}
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform