I need to identify the random key from the text,is it possible in Regex

Hello,

The key 2 is GUZCYA6DAKMVVKAB.

If you have issues then you have to request for new activation code.

Thank you

“How to get the KEY 2, using regex
the condition is the KEY will contain only capital letters and it will be a 16digit,it will contain at least 1 number and it should not contain any alpha numeric characters in it”

to add more the text will be of different format/content depends upon the user,the only standard part is the key with 16digit and contains at least 1 number in it

@Saravanan_Murugan,

Simple, please use following regex,

([A-Z0-9]){16}

image

yes, i have tried the same,but it is not capturing the mandatory field like atleast 1 number in it

Like in your text it is capturing both GUZCYA6DAKMVVKAB and ABCNOJDHTEKSMNDK

it should capture only the GUZCYA6DAKMVVKAB

and also if the character is more than 16 it should not capture

1 Like

@Saravanan_Murugan - Please check this…

Case1: 16 with one numeric value → Correct

Case 2: greater than 16 → incorrect

Case 3: 16 but with no numeric values → Incorrect…

Thanks,for the expression

but i have one more condition too, like the text key 2 will not always be there

we will get the key expression in random formats(like the 16 digit(capital letters which includes atleast 1 number) can be placed at any point of place without any indicator elements)

Here you go…

@Saravanan_Murugan - Please let me know, if this satisfies your conditions??

Thanks a lot, that works

1 Like

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