Got more questions? Find advice on: ASP | SQL | XML | Windows
Welcome to RegexAdvice Sign in | Join | Help

Matching Inputs and Displaying

  •  12-09-2006, 5:06 PM

    Matching Inputs and Displaying

    Hi, I'm having some trouble with my code. I'm using python to take in information from a form/website in order to link the user to another website. My problem is thus:
    ------------------------------------------------
    ae = re.compile('[A-E]')
    fl = re.compile('[F-L]')
    mw = re.compile('[M-W]')
    if f.has_key('key') and f['key'].value !='':
        firstForm=False
        print "hi"
        if ae.match(f['key'].value,0):
          print "http://www...A_E.htm"
        elif fl.match(f['key'],0):
          print "http://www...F_L.htm"
        elif mw.match(f['key'],0):
          print "http://www...M_W.htm"
        else:
          print "Error"
        fields['key'] = str(form['key'].value)
    ------------------------------------------
    I tried it with both:
        if ae.match(form['key'].value,0):
    and
        if ae.match(f['key'].value,0):
    and both without the .value in it. I don't think it should make a difference.

    Uh... how this works, say someone inputs CD23124, it should link them to the "...A_E.htm" site.

View Complete Thread