   (if pos (goto-char pos))
   (let (next-start-tag
         next-end-tag) ;; end var defs
-    (if (re-search-forward "\\[.+\\]" nil t)
+    (if (re-search-forward jpw-tag-finder-re nil t)
         (progn
           (goto-char (match-beginning 0))
-          (if (looking-at "\\[/")
+          (if (looking-at jpw-tag-end-re)
               (setq next-end-tag (point))
             ;;else
             (setq next-start-tag (point))

    (progn
      (setq phpBB-mode-map (make-sparse-keymap))
      ;;(define-key phpBB-mode-map "\M-\"" 'phpBB-unfill-paragraphs)

      (define-key phpBB-mode-map "\M-g\M-[i" 'phpBB-insert-italic)
      (define-key phpBB-mode-map "\M-pi" 'phpBB-insert-italic)

  (let (last-start-tag
        last-end-tag
        the-tag) ;; end var defs
    (if (re-search-backward jpw-tag-finder-re nil t)
        (if (looking-at jpw-tag-end-re)
            (setq last-end-tag (point))
          ;;else
          (setq last-start-tag (point))
