     # Verification
     keyToVerify = key
     [array, index] = [false, undefined]
-    arrayPattern = /([A-Za-z]+)(\d+)/
-    match = key.match(arrayPattern)
+    match = key.match(Header.arrayPattern)
     if match?
       keyToVerify = match[1]
       [array, index] = [true, match[2]]

      value = @verifyCard[keyToVerify](value, array, index)

    switch key
      when "COMMENT"
        @setComment(value)
      when "HISTORY"
        @setHistory(value)
      else
        @set(key, value, comment)
        @.__defineGetter__(key, -> return @cards[key][1])

Module      = require('module')
VerifyCards = require('fits.header.verify')

# Header parses and stores the FITS header.  Verification is done for reserved
# keywords (e.g. SIMPLE, BITPIX, etc)
class FITS.Header extends Module
  @keywordPattern   = /([\w_-]+)\s*=?\s*(.*)/
  @nonStringPattern = /([^\/]*)\s*\/*(.*)/
  @stringPattern    = /'(.*)'\s*\/*(.*)/
  @arrayPattern     = /([A-Za-z]+)(\d+)/
  @include VerifyCards
  
  constructor: ->
