 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*(.*)/
+  @keywordPattern   = /([\w_-]+)\s*=?\s*(.*)/
   @nonStringPattern = /([^\/]*)\s*\/*(.*)/
-  @stringPattern = /'(.*)'\s*\/*(.*)/
+  @stringPattern    = /'(.*)'\s*\/*(.*)/
+  @arrayPattern     = /([A-Za-z]+)(\d+)/
   @include VerifyCards
   
   constructor: ->


  # Set comment from the COMMENT keyword
  setComment: (comment) ->
    unless @cards.hasOwnProperty("COMMENT")
      @cards["COMMENT"] = []
      @cardIndex += 1
    @cards["COMMENT"].push(comment)

  # Set history from the HISTORY keyword
  setHistory: (history) ->
    unless @cards.hasOwnProperty("HISTORY")
      @cards["HISTORY"] = []
      @cardIndex += 1
    @cards["HISTORY"].push(history)

    # Verification
    keyToVerify = key
    [array, index] = [false, undefined]
    match = key.match(Header.arrayPattern)
    if match?
      keyToVerify = match[1]
      [array, index] = [true, match[2]]
