basically I need help with checking if a certain string contains a certain pattern:
Here are a few strings in an array:
[ "please use this key: ')D9ad-98ada-jiada-8a8aa'",
"kK8AD-AODK8-ADA7A",
"heres a free game for you guys dkaa2-21ddd-9a9aa-9wada"
]
I need to check the entire array, for keys, that follow this key format from Steam:
Please keep the real keys formats, as told by steam and seen bellow:
AAAAA-BBBBB-CCCCC
AAAAA-BBBBB-CCCCC-DDDDD-EEEEE
I know I would need a for loop like this:
for(var i=0;i<arrayName.length;i++) {
// What should be in here?
}
What should be //In there? To check the strings in the array for that certain Key Pattern.
also, please keep in mind that I first need to remove the text, and then check the key.
Thanks for the help!
I propose you a solution without Regex. You'll have to find by yourself a solution with Regex as a homework