quote:
Originally posted by markee
(though using the test method is better than the exec method used by Cookie in my opinion). Apart from that, good job.
there is a difference between the two and each has its uses. With the test method the global properties of the RegExp are not updated. It are these properties which are used further, so you need to use the exec method.