(define (match t p)
  (define n-t (string-length t))
  (define n-p (string-length p))
  (let loop
    ((i-t 0)
     (i-p 0))
    (cond
      ((> i-p (- n-p 1))
       i-t)
      ((> i-t (- n-t n-p))
       #f)
      ((eq? (string-ref t (+ i-t i-p)) (string-ref p i-p))
       (loop i-t (+ i-p 1)))
      (else
       (loop (+ i-t 1) 0)))))

(define (wildcard-match text pattern)
  (define first (match text (car pattern)))
  (define second (match text (cadr pattern)))
  (cond        ((or (eq? first #f) (eq? second #f)) #f)
               ((> second first) (list first second))
               (else #f)))