   (interactive)
   (goto-char (line-beginning-position))
   (when (re-search-forward ledger-post-line-regexp (line-end-position) t)
-    (goto-char (match-end 3))
+    (goto-char (match-end ledger-regex-post-line-group-account))
     (when (re-search-forward "[-.,0-9]+" (line-end-position) t)
       (let ((val (match-string 0)))
 	(goto-char (match-beginning 0))

    (define-key map [(control ?c) (control ?c)] 'ledger-post-pick-account)
    (define-key map [(control ?c) (control ?e)] 'ledger-post-edit-amount))
  (if ledger-post-auto-adjust-amounts
      (add-hook 'after-change-functions 'ledger-post-maybe-align t t)))

(add-hook 'ledger-mode-hook 'ledger-post-setup)


	    (if (looking-at "[ \t]\\( [ \t]\\|\t\\)")
		(delete-char 1)))))))
    (goto-char pos)))

(defun ledger-align-amounts (&optional column)
  "Align amounts in the current region.
This is done so that the last digit falls in COLUMN, which defaults to 52."
  (interactive "p")
  (if (or (null column) (= column 1))
      (setq column ledger-post-amount-alignment-column))
  (save-excursion
    (let* ((mark-first (< (mark) (point)))
	   (begin (if mark-first (mark) (point)))
	   (end (if mark-first (point-marker) (mark-marker)))
	   offset)
      (goto-char begin)
      (while (setq offset (ledger-next-amount end))
	(let ((col (current-column))
	      (target-col (- column offset))
	      adjust)
	  (setq adjust (- target-col col))
	  (if (< col target-col)
	      (insert (make-string (- target-col col) ? ))
	    (move-to-column target-col)
	    (if (looking-back "  ")
		(delete-char (- col target-col))
	      (skip-chars-forward "^ \t")
	      (delete-horizontal-space)
	      (insert "  ")))
	  (forward-line))))))

(defun ledger-post-align-amount ()
  (interactive)
