I have an input which can have up to 50 ASCII characters with a hidden pattern that I need to find. The pattern is the letter A (case insensitive) followed by 8 digits. Only the first pattern (if exists) needs to be found. So an example input can be lkjs#$9234A12345678*)(&kj
How do I do this in JavaScript?
var input = 'lkjs#$9234A12345678*)(&kj';
var regex = '[Aa][0-9]{8}';
var index = input.search(regex);
if (index >= 0) {
//found pattern - but how to extract it???
}