Glad to hear it worked okay for you.
JavaScript references the elements of a page through what is called the 'document' object.
For example, to reference the second image in a page and assign it an image source file you could use (remember JavaScript counts from 0) :
document.images[1].src="myimage.gif";
'document' is the object, 'images' is an array that references the images on the page, 'src' is the equivalent of the <img> tag's 'src' attribute.
To get to the images you need to go through the document object using what is called 'dot' notation - objects are separated form their properties and methods by dots.
In this example :
document.form_name.field_name.value
'document' is the object, 'form_name' is the name of the form, 'field_name' is the name of the form element - perhaps a text box.
'document' and 'value' are pre-defined and must not be changed but you can name your form and form element just about anything you want to.
/^[0-9A-Z]+$/i is an example of a regular expression. Regular expressions ( regexes ) allow very powerful text manipulation and are found in most languages. In fact the previous example could be implemented in PHP, VBScript, Perl etc, as well as JavaScript, with each language having its own syntax for doing so.
Languages like JavaScript inherit their regexes from Perl. Often a language will be described as supporting PCRE ( Perl Compatible Regular Expressions )
Here is an explanation of the syntax I used :
/ starts and ends the expression
using ^ and $ forces an exact match
[0-9A-Z] means match any character that belongs to the character ranges inside the square brackets
+ means match one or more times
i makes it a case insensitive match
Even if someone is very familiar with programming languages regular expressions can look alien but they are well worth getting to grips with and they are easily ported between languages.
Sometimes isNaN(), indexOf() and charAt() etc, will get a job done without the need for regexes but in your scenario I think regexes are the best approach.
Enjoy catching fish!
HTH