I want to write a javascript to search a textfield for a given value say "104B-XX-XXX" the "X"s represent any numbers between 0-9.
If the textfield contains this value (e.g. 104B-38-293) I would like to set a global variable value to equal this 104B-38-293.
I thought a RegExp would be the correct method to use for this situation, however I am having trouble understanding how to apply the RegExp to the entire textfield and obtain the value (104B-38-293).
Would someone please explain how I search the textfield for this value using a RegExp? RegExp now doesn't seem appropriate because I want to copy the value from the textfield.