Help in veryfing text of a Text Box

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

This extension will help:

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)

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. :yum:

2 Likes

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

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.