 
 (ledger-define-regexp post-line
     (macroexpand
-     `(rx (and line-start
-	       (? (and (+ space) (regexp ,ledger-state-regexp)))
-	       (+ space) (regexp ,ledger-full-account-regexp)
-	       (+ space) (regexp ,ledger-full-amount-regexp)
+     `(rx (and line-start (+ blank)
+	       (? (and (regexp ,ledger-state-regexp) (* blank)))
+	       (regexp ,ledger-full-account-regexp)
+	       (? (and (regexp ,ledger-long-space-regexp)
+		       (regexp ,ledger-full-amount-regexp)))
 	       (? (regexp ,ledger-end-note-regexp))
 	       line-end)))
   ""
   state
   (account-kind full-account kind)
-  (account-name full-account name)
+  (account full-account name)
   (amount full-amount)
   (note end-note))
 

    (macroexpand
     `(rx (and line-start
	       (regexp ,ledger-full-date-regexp)
	       (? (and (+ space) (regexp ,ledger-state-regexp)))
	       (? (and (+ space) (regexp ,ledger-code-regexp)))
	       (+ space) (+? nonl)
	       (? (regexp ,ledger-end-note-regexp))
	       line-end)))
  "Match a transaction's first line (and optional notes)."

  (note end-note))

(ledger-define-regexp account
    (rx (group (and (not (any blank ?\[ ?\( ?: ?\;)) (*? nonl))))
  "")

(ledger-define-regexp account-kind
    (rx (group (? (any ?\[ ?\())))
  "")

(ledger-define-regexp full-account
