gajato
(Niko)
July 19, 2019, 4:53am
#1
Hello people, I want to validate a textbox text which is PAN CARD NUMBER.
PAN CARD NUMBER formate is 4+4+2 (First 4 alfabets, next 4 is digits and last 2 is alfabests again)
So far, I tried this but it is not working for me.
I spent a lot of time to find the right logic but I failed everysingle time.
Someone can help me correct it or give me right direction towards my destination where I can archive what I want.
Thanks in advance.
2 Likes
Ken
(Ken)
July 19, 2019, 5:07am
#2
This extension will help:
Hi there. Here is my first extesion: Regular expression extension The below photo explains what it can do. Hope you like it. and the aix: cn.kevinkun.RegEx.aix (5.8 KB)
Reading time: 3 mins π
Likes: 48 β€
This block:
Use this Pattern:
[a-zA-Z]{4}[0-9]{4}[a-zA-Z]{2}
Example:
https://regex101.com/r/sjaZdt/1
4 Likes
Try this to check the input of each character in real time by a timer
textbox_10chars.aia (6.0 KB)
Robert
(rickastlee)
July 19, 2019, 11:14am
#4
Initialize two list from csv row: one of full alphabet, including both cases and one of numbers.
charposition = 0
For each character in text:
char = charpositionth character of text
If charposition < 5 or charposition > 6 then:
If not is list item char of list alphabetlist:
WRONG!
Else if charposition < 8 then:
If not is list item char of list numberlist:
WRONG!
charposition += 1
This is how it is perfected but not all of us can understand RegEx.
2 Likes
Ken
(Ken)
July 19, 2019, 11:51am
#6
Thatβs why I included the Pattern that will match 4 Letters 4 Numbers 2 Letters and the link to an example at regex101.com .
That site is awesome when trying to figure out which Pattern to use.
4 Likes
system
(system)
Closed
August 18, 2019, 11:51am
#7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.