Click here to Skip to main content
15,917,176 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I need regular expression for alphanumeric of 4 digit and 4 alphabets only.
Posted
Updated 20-Feb-11 22:52pm
v3
Comments
Sunasara Imdadhusen 21-Feb-11 0:29am    
Did you try anything for that?
goelhima 21-Feb-11 0:30am    
i dont know y.... but i am not able to write question.... might be slow connection.
I need regular expression for 4alphabets and 4 digits only. and it should be in this sequence only. I tried to modified many code but i m not able to get the right code. Please help me. Its very urgent.
thanx.
goelhima 21-Feb-11 0:33am    
@Sunasara- Yes i tried many regular expression and modified them. But i m not getting the ryt one. I got for mixed one lyk 4 digit and 4 alphabets but the problem is that user can write in any way means he can write one numeric one alphabet in any sequence.... but i want only 4alphabets first than 4 numeric....not any mix match

goelhima wrote:
but i want only 4alphabets first than 4 numeric


[a-z]{4}[0-9]{4}
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 21-Feb-11 0:42am    
This one matched low-case characters only. You need upper case also.
--SA
Prerak Patel 21-Feb-11 1:08am    
You can anyway ignore the case if you wish.
Sergey Alexandrovich Kryukov 21-Feb-11 1:42am    
As Grep option? agree.
Will vote 5.
--SA
goelhima 21-Feb-11 0:43am    
thnx u so much.... its working :)
i was trying so complicated one but it was not working ..... now this simple one is working ;)
Sergey Alexandrovich Kryukov 21-Feb-11 0:45am    
You need my answer.
--SA
[a-zA-Z]{4}[0-9]{4}


—SA
 
Share this answer
 
v2
Comments
goelhima 21-Feb-11 0:47am    
i write in a same way :) thnx....
Sergey Alexandrovich Kryukov 21-Feb-11 0:59am    
You're welcome.
--SA
Espen Harlinn 21-Feb-11 9:41am    
Nice and simple, my 5
Sergey Alexandrovich Kryukov 21-Feb-11 16:23pm    
Thank you; easy exercise.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900